From cbf85c1902e0a23a7230feed32cd5f63ec3c7b8b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 1 Feb 2008 10:52:08 +0100 Subject: [PATCH] prioritize UnmapEvent-s --- awesome.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/awesome.c b/awesome.c index a0b68a6a6..c55af9941 100644 --- a/awesome.c +++ b/awesome.c @@ -402,9 +402,18 @@ main(int argc, char *argv[]) { while(XPending(dpy)) { - XNextEvent(dpy, &ev); - if(handler[ev.type]) - handler[ev.type](&ev); /* call handler */ + /* Unmap are prio otherwise we risk to SetInputFocus on unmapped + * windows */ + while(XCheckMaskEvent(dpy, UnmapNotify, &ev)) + if(handler[ev.type]) + handler[ev.type](&ev); + + if(XPending(dpy)) + { + XNextEvent(dpy, &ev); + if(handler[ev.type]) + handler[ev.type](&ev); + } /* drop events requested to */ if(globalconf.drop_events)