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.
This commit is contained in:
Spencer Janssen
2007-12-11 07:48:10 +00:00
parent 287d364e0d
commit f427c2b0e9
2 changed files with 4 additions and 2 deletions

View File

@@ -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.

View File

@@ -77,7 +77,6 @@ unmanage :: Window -> X ()
unmanage w = do
windows (W.delete w)
setWMState w withdrawnState
modify (\s -> s {mapped = S.delete w (mapped s), waitingUnmap = M.delete w (waitingUnmap s)})
-- | Modify the size of the status gap at the top of the current screen
-- Taking a function giving the current screen, and current geometry.