summaryrefslogtreecommitdiffstats
path: root/XMonad.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-06-06 23:40:06 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-06-06 23:40:06 +0200
commit89605d843ddf353e29e0727f90770a4db3097030 (patch)
treeb4db0e066658b6ccd4afb4e4dd79496800d55e80 /XMonad.hs
parent1942cef8ab9f3c9ae5bf4c7c37928ed0fd01af6c (diff)
downloadmetatile-89605d843ddf353e29e0727f90770a4db3097030.tar
metatile-89605d843ddf353e29e0727f90770a4db3097030.zip
Fix unmap handling
According to the ICCCM, clients should send a synthetic unmap event when they initiate an unmap. The old code waited for these synthetic unmaps to unmanage windows. However, certain 'obsolete' clients do not send synthetic unmaps (notably xpdf's find dialog). These windows entered a zombified state: xmonad does not manage them, yet they are still mapped and raised on screen. The new algorithm (derived from wmii): - track windows that are mapped on screen - track the number of expected unmap events for each window, increment every time 'hide' is called on a window that is not mapped. - decrement the expected unmap counter on each unmap event - treat an unmap event as genuine (ie. unmap the window) when: - the event is synthetic (per ICCCM) - OR there are no expected unmap events for this window darcs-hash:20070606214006-a5988-7c2eced85319ff506a9b7c9dc86d5946ca0da8e5
Diffstat (limited to 'XMonad.hs')
-rw-r--r--XMonad.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/XMonad.hs b/XMonad.hs
index 8cf9b95..01d4199 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -34,16 +34,18 @@ import Graphics.X11.Xlib
import Data.Typeable
import qualified Data.Map as M
+import qualified Data.Set as S
-- | XState, the window manager state.
-- Just the display, width, height and a window list
data XState = XState
- { windowset :: !WindowSet -- ^ workspace list
- , xineScreens :: ![Rectangle] -- ^ dimensions of each screen
- , statusGaps :: ![(Int,Int,Int,Int)] -- ^ width of status bar on each screen
- , layouts :: !(M.Map WorkspaceId (Layout, [Layout])) }
+ { windowset :: !WindowSet -- ^ workspace list
+ , xineScreens :: ![Rectangle] -- ^ dimensions of each screen
+ , statusGaps :: ![(Int,Int,Int,Int)] -- ^ width of status bar on each screen
+ , mapped :: !(S.Set Window) -- ^ the Set of mapped windows
+ , waitingUnmap :: !(M.Map Window Int) -- ^ the number of expected UnmapEvents
+ , layouts :: !(M.Map WorkspaceId (Layout, [Layout])) }
-- ^ mapping of workspaces to descriptions of their layouts
-
data XConf = XConf
{ display :: Display -- ^ the X11 display
, theRoot :: !Window -- ^ the root window