X-Git-Url: http://pileus.org/git/?p=wmpus;a=blobdiff_plain;f=sys-xcb.c;fp=sys-xcb.c;h=af650cd2c1d648fefd60cc357f8788ca6149f463;hp=587add1f13db1ce45819530879ab47345b0f0729;hb=5b87a56239c6bd1977e64965a5002010f2b53bc8;hpb=6e727b79920302fb99b1905af34a25e745a982ef diff --git a/sys-xcb.c b/sys-xcb.c index 587add1..af650cd 100644 --- 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;