aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Main.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-12-11 08:48:10 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-12-11 08:48:10 +0100
commitdad05153b2268d2df6c9160f5142604458d9741e (patch)
tree67c0249c4648097052867a76517deca8534ffda3 /XMonad/Main.hs
parent9affed07b918752f84a7ecc3810a9c8e89dee473 (diff)
downloadxmonad-dad05153b2268d2df6c9160f5142604458d9741e.tar.gz
xmonad-dad05153b2268d2df6c9160f5142604458d9741e.tar.xz
xmonad-dad05153b2268d2df6c9160f5142604458d9741e.zip
Clean up stale mapped/waitingUnmap state in handle rather than unmanage.
This is an attempt to fix issue #96. Thanks to jcreigh for the insights necessary to fix the bug. darcs-hash:20071211074810-a5988-47be5e16650bf0c0ad5d0e638d03753a78958fd6.gz
Diffstat (limited to 'XMonad/Main.hs')
-rw-r--r--XMonad/Main.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/XMonad/Main.hs b/XMonad/Main.hs
index c25eabf..60d8e6a 100644
--- a/XMonad/Main.hs
+++ b/XMonad/Main.hs
@@ -143,7 +143,10 @@ handle (MapRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do
-- window destroyed, unmanage it
-- window gone, unmanage it
-handle (DestroyWindowEvent {ev_window = w}) = whenX (isClient w) $ unmanage w
+handle (DestroyWindowEvent {ev_window = w}) = whenX (isClient w) $ do
+ unmanage w
+ modify (\s -> s { mapped = S.delete w (mapped s)
+ , waitingUnmap = M.delete w (waitingUnmap s)})
-- We track expected unmap events in waitingUnmap. We ignore this event unless
-- it is synthetic or we are not expecting an unmap notification from a window.