summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-09-11 16:22:33 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-09-11 16:22:33 +0200
commitccbc4c12236407083f3a3ebcd2d53be762f35eb5 (patch)
tree083654ca237e0d7d01c46a4e9590ee37a6eae8a4 /XMonad
parent5ecc5d245c1733fcf6433c1ed710b715b8a1eabb (diff)
downloadmetatile-ccbc4c12236407083f3a3ebcd2d53be762f35eb5.tar
metatile-ccbc4c12236407083f3a3ebcd2d53be762f35eb5.zip
Correctly handle synthetic unmap events
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Main.hsc9
1 files 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