aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/Decoration.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2008-02-04 01:54:13 +0100
committerDavid Roundy <droundy@darcs.net>2008-02-04 01:54:13 +0100
commit32a6494ee7c0b65e18baab62e61e0c1d33e29d01 (patch)
tree496aaaa45ebfc8be038d159591f25b49c26d279d /XMonad/Layout/Decoration.hs
parent4694cbf5491da9ea3733246e39d1328339453e84 (diff)
downloadXMonadContrib-32a6494ee7c0b65e18baab62e61e0c1d33e29d01.tar.gz
XMonadContrib-32a6494ee7c0b65e18baab62e61e0c1d33e29d01.tar.xz
XMonadContrib-32a6494ee7c0b65e18baab62e61e0c1d33e29d01.zip
in Decoration, remove windows that are precisely hidden underneath other windows.
This is needed for WindowNavigation to work properly with the new Decorations framework. darcs-hash:20080204005413-72aca-7aa06211c7080d3d4f485017183251e3e6f440ab.gz
Diffstat (limited to 'XMonad/Layout/Decoration.hs')
-rw-r--r--XMonad/Layout/Decoration.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/XMonad/Layout/Decoration.hs b/XMonad/Layout/Decoration.hs
index 24fc133..4d20ac1 100644
--- a/XMonad/Layout/Decoration.hs
+++ b/XMonad/Layout/Decoration.hs
@@ -133,8 +133,13 @@ instance (DecorationStyle ds Window, Shrinker s) => LayoutModifier (Decoration d
todel d = filter (flip elem d . get_w)
toadd a = filter (flip elem a . fst )
- insert_dwr ((w,r),(dw,Just dr)) xs = (dw,dr):(w, shrink ds dr r):xs
- insert_dwr (x ,(_ ,Nothing)) xs = x:xs
+ -- We drop any windows that are *precisely* stacked underneath
+ -- another window: these must be intended to be tabbed!
+ insert_dwr otherRs (((w,r),(dw,Just dr)):zzz)
+ | r `elem` otherRs = (dw,dr):insert_dwr otherRs zzz
+ | otherwise = (dw,dr):(w, shrink ds dr r):insert_dwr (r:otherRs) zzz
+ insert_dwr otherRs (((w,r),(_ ,Nothing)):zzz) = (w,r):insert_dwr (r:otherRs) zzz
+ insert_dwr _ [] = []
resync _ [] = return []
resync d ((w,r):xs) = case w `elemIndex` get_ws d of
@@ -147,7 +152,7 @@ instance (DecorationStyle ds Window, Shrinker s) => LayoutModifier (Decoration d
processState s = do ndwrs <- resync (decos s) wrs
showWindows (getDWs ndwrs)
updateDecos sh c (font s) ndwrs
- return (foldr insert_dwr [] ndwrs, Just (Decoration (I (Just (s {decos = ndwrs}))) sh c ds))
+ return (insert_dwr [] ndwrs, Just (Decoration (I (Just (s {decos = ndwrs}))) sh c ds))
handleMess (Decoration (I (Just s@(DS {decos = dwrs}))) sh c ds) m
| Just e <- fromMessage m :: Maybe Event = handleEvent sh c s e >> return Nothing