]> Pileus Git - wmpus/commitdiff
Add map and unmap handlers
authorAndy Spencer <andy753421@gmail.com>
Wed, 15 Apr 2015 20:06:15 +0000 (20:06 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 15 Apr 2015 20:06:15 +0000 (20:06 +0000)
sys-xcb.c

index 587add1f13db1ce45819530879ab47345b0f0729..af650cd2c1d648fefd60cc357f8788ca6149f463 100644 (file)
--- a/sys-xcb.c
+++ b/sys-xcb.c
@@ -563,6 +563,26 @@ static void on_destroy_notify(xcb_destroy_notify_event_t *event)
        free(win);
 }
 
+static void on_unmap_notify(xcb_unmap_notify_event_t *event)
+{
+       win_t *win = win_get(event->window);
+       printf("on_unmap_notify:      xcb=%-8u -> win=%p\n",
+                       event->window, win);
+       if (!win) return;
+
+       send_state(win, ST_HIDE);
+}
+
+static void on_map_notify(xcb_map_notify_event_t *event)
+{
+       win_t *win = win_get(event->window);
+       printf("on_map_notify:        xcb=%-8u -> win=%p\n",
+                       event->window, win);
+       if (!win) return;
+
+       send_state(win, ST_SHOW);
+}
+
 static void on_map_request(xcb_map_request_event_t *event)
 {
        win_t *win = win_get(event->window);
@@ -647,6 +667,12 @@ static void on_event(xcb_generic_event_t *event)
                case XCB_DESTROY_NOTIFY:
                        on_destroy_notify((xcb_destroy_notify_event_t *)event);
                        break;
+               case XCB_UNMAP_NOTIFY:
+                       on_unmap_notify((xcb_unmap_notify_event_t *)event);
+                       break;
+               case XCB_MAP_NOTIFY:
+                       on_map_notify((xcb_map_notify_event_t *)event);
+                       break;
                case XCB_MAP_REQUEST:
                        on_map_request((xcb_map_request_event_t *)event);
                        break;