From 5b87a56239c6bd1977e64965a5002010f2b53bc8 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Wed, 15 Apr 2015 20:06:15 +0000 Subject: [PATCH] Add map and unmap handlers --- sys-xcb.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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; -- 2.43.2