From 026247cf181c88a3331275ce7e40b30d1cbd2591 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 28 Dec 2009 19:26:00 +0100 Subject: [PATCH] Handle synthetic UnmapNotify events *correctly* Second try: Turns out I messed up with XCB_EVENT_SENT() and had a "!" too much. The old code already tried to cope with this, but forgot to actually unmap the window which it just set to withdrawn state. This time I tested the patch *again* and now I found even less bugs than on my last try. P.S.: I suck. Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- event.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/event.c b/event.c index 370d9ae0e..baaa92b70 100644 --- a/event.c +++ b/event.c @@ -666,9 +666,11 @@ event_handle_unmapnotify(void *data __attribute__ ((unused)), if((c = client_getbywin(ev->window))) { if(ev->event == xutil_screen_get(connection, c->phys_screen)->root - && XCB_EVENT_SENT(ev) - && xwindow_get_state_reply(xwindow_get_state_unchecked(c->window)) == XCB_WM_STATE_NORMAL) + && XCB_EVENT_SENT(ev)) + { client_unmanage(c); + xcb_unmap_window(connection, ev->window); + } } else for(int i = 0; i < globalconf.embedded.len; i++)