diff options
author | Stefan O'Rear <stefanor@cox.net> | 2007-06-04 06:23:43 +0200 |
---|---|---|
committer | Stefan O'Rear <stefanor@cox.net> | 2007-06-04 06:23:43 +0200 |
commit | a1737a36132b2867a1c795c5c5bb32cb130b74c0 (patch) | |
tree | 60d0be0b967c763064b3e2ec831c126d851e9836 /Main.hs | |
parent | 54d3c8e2d69754671ea9196384122d0202aa7a47 (diff) | |
download | xmonad-a1737a36132b2867a1c795c5c5bb32cb130b74c0.tar.gz xmonad-a1737a36132b2867a1c795c5c5bb32cb130b74c0.tar.xz xmonad-a1737a36132b2867a1c795c5c5bb32cb130b74c0.zip |
Set WM_STATE, iconify invisible windows (+9 loc)
Note that this breaks compatibility with certain programs described as
"obsolete" in the ICCCM (1994). See the command above the UnmapEvent handler
for details.
darcs-hash:20070604042343-e3110-4766eafca2875091189159f6a1df29eac3c21387.gz
Diffstat (limited to '')
-rw-r--r-- | Main.hs | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -144,12 +144,23 @@ handle (KeyEvent {ev_event_type = t, ev_state = m, ev_keycode = code}) -- manage a new window handle (MapRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do wa <- io $ getWindowAttributes dpy w -- ignore override windows - when (not (wa_override_redirect wa)) $ manage w + -- need to ignore mapping requests by managed windows not on the current workspace + managed <- isClient w + when (not (wa_override_redirect wa) && not managed) $ do manage w -- window destroyed, unmanage it -- window gone, unmanage it handle (DestroyWindowEvent {ev_window = w}) = whenX (isClient w) $ unmanage w -handle (UnmapEvent {ev_window = w}) = whenX (isClient w) $ unmanage w + +-- We only handle synthetic unmap events, because real events are confusable +-- with the events produced by 'hide'. ICCCM says that all clients should send +-- synthetic unmap events immediately after unmapping, and later describes +-- clients that do not follow the rule as "obsolete". For now, we make the +-- simplifying assumption that nobody uses clients that were already obsolete +-- in 1994. Note that many alternative methods for resolving the hide/withdraw +-- ambiguity are racy. + +handle (UnmapEvent {ev_window = w, ev_send_event = True}) = whenX (isClient w) $ unmanage w -- set keyboard mapping handle e@(MappingNotifyEvent {ev_window = w}) = do |