aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-10 00:38:59 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-10 00:38:59 +0800
commite8e71847dccceee038338dab4e430957639f3d63 (patch)
treece010dfae18467dc1960e2fe745d4f6a0e28c275 /src
parentaa4b59d594a962f34a7737a015703f0878c73b35 (diff)
downloadcru-e8e71847dccceee038338dab4e430957639f3d63.tar.gz
cru-e8e71847dccceee038338dab4e430957639f3d63.tar.bz2
cru-e8e71847dccceee038338dab4e430957639f3d63.zip
xcb window visibility event.
Diffstat (limited to 'src')
-rw-r--r--src/platform/gui/xcb/Window.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/platform/gui/xcb/Window.cpp b/src/platform/gui/xcb/Window.cpp
index 67568dce..3f22e6b0 100644
--- a/src/platform/gui/xcb/Window.cpp
+++ b/src/platform/gui/xcb/Window.cpp
@@ -59,6 +59,12 @@ IEvent<std::nullptr_t> *XcbWindow::CreateEvent() { return &create_event_; }
IEvent<std::nullptr_t> *XcbWindow::DestroyEvent() { return &destroy_event_; }
+IEvent<std::nullptr_t> *XcbWindow::PaintEvent() { return &paint_event_; }
+
+IEvent<WindowVisibilityType> *XcbWindow::VisibilityChangeEvent() {
+ return &visibility_change_event_;
+}
+
IEvent<Size> *XcbWindow::ResizeEvent() { return &resize_event_; }
IEvent<FocusChangeType> *XcbWindow::FocusEvent() { return &focus_event_; }
@@ -140,6 +146,14 @@ void XcbWindow::HandleEvent(xcb_generic_event_t *event) {
}
break;
}
+ case XCB_MAP_NOTIFY: {
+ visibility_change_event_.Raise(WindowVisibilityType::Show);
+ break;
+ }
+ case XCB_UNMAP_NOTIFY: {
+ visibility_change_event_.Raise(WindowVisibilityType::Hide);
+ break;
+ }
case XCB_FOCUS_IN: {
focus_event_.Raise(FocusChangeType::Gain);
break;
@@ -236,6 +250,14 @@ std::optional<xcb_window_t> XcbWindow::GetEventWindow(
(xcb_configure_notify_event_t *)event;
return configure->event;
}
+ case XCB_MAP_NOTIFY: {
+ xcb_map_notify_event_t *map = (xcb_map_notify_event_t *)event;
+ return map->event;
+ }
+ case XCB_UNMAP_NOTIFY: {
+ xcb_unmap_notify_event_t *unmap = (xcb_unmap_notify_event_t *)event;
+ return unmap->event;
+ }
case XCB_FOCUS_IN: {
xcb_focus_in_event_t *fi = (xcb_focus_in_event_t *)event;
return fi->event;