From 32a6494ee7c0b65e18baab62e61e0c1d33e29d01 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Mon, 4 Feb 2008 01:54:13 +0100 Subject: 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 --- XMonad/Layout/Decoration.hs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout/Decoration.hs') 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 -- cgit v1.2.3