From ccbc4c12236407083f3a3ebcd2d53be762f35eb5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 11 Sep 2013 16:22:33 +0200 Subject: Correctly handle synthetic unmap events --- XMonad/Main.hsc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/XMonad/Main.hsc b/XMonad/Main.hsc index 706c5a0..224631c 100644 --- a/XMonad/Main.hsc +++ b/XMonad/Main.hsc @@ -214,11 +214,10 @@ handle (DestroyWindowEvent {ev_window = w}) = do -- it is synthetic or we are not expecting an unmap notification from a window. handle UnmapEvent {ev_window = w, ev_send_event = synthetic, ev_event = we} = whenX (isClient w) $ do rootw <- asks theRoot - when (we /= rootw) $ do - e <- getsWindowState wsWaitingUnmap w - if (synthetic || e == 0) - then unmanage w >> hideParent w - else modifyWindowState (\ws -> ws { wsWaitingUnmap = (wsWaitingUnmap ws) - 1 }) w + e <- getsWindowState wsWaitingUnmap w + if (synthetic || (e == 0 && we /= rootw)) + then unmanage w >> hideParent w + else when (e > 0) $ modifyWindowState (\ws -> ws { wsWaitingUnmap = e - 1 }) w -- set keyboard mapping handle e@(MappingNotifyEvent {}) = do -- cgit v1.2.3