summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-07-24 16:13:10 +0200
committerDavid Roundy <droundy@darcs.net>2007-07-24 16:13:10 +0200
commitd7a2bd0029f841061819cbc8f3a124b94cdfd002 (patch)
tree5965163c1a4c3ba8f6a8388e0646c5ee03aadc26
parent215b5fabba19875f9032d7ce7bf33c0291149b47 (diff)
downloadmetatile-d7a2bd0029f841061819cbc8f3a124b94cdfd002.tar
metatile-d7a2bd0029f841061819cbc8f3a124b94cdfd002.zip
only display any given window once.
This change goes along with the sticky window work. It makes xmonad display each window once and only once, with preference given to the focussed screen. It has no effect when there are no duplicate windows, except to make things less efficient. We could do better using Data.Set (or Data.Map) to store the set of windows that are visible. darcs-hash:20070724141310-72aca-aa02163e9375d7a7966c74c0a82d7b14c2b30e44
-rw-r--r--Operations.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Operations.hs b/Operations.hs
index dce8195..5654505 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -141,13 +141,17 @@ windows f = do
d <- asks display
-- for each workspace, layout the currently visible workspaces
- visible <- fmap concat $ forM (W.current ws : W.visible ws) $ \w -> do
+ let allscreens = W.current ws : W.visible ws
+ each_visible = map (W.integrate' . W.stack . W.workspace) allscreens
+ summed_visible = reverse $ foldl (\ (x:xs) y -> ((x++y):x:xs)) [[]] each_visible
+ visible <- fmap concat $ forM (zip allscreens summed_visible) $ \ (w, vis) -> do
let n = W.tag (W.workspace w)
this = W.view n ws
Just l = fmap fst $ M.lookup n fls
flt = filter (flip M.member (W.floating ws)) (W.index this)
tiled = (W.stack . W.workspace . W.current $ this)
>>= W.filter (not . flip M.member (W.floating ws))
+ >>= W.filter (not . (`elem` vis))
(SD (Rectangle sx sy sw sh)
(gt,gb,gl,gr)) = W.screenDetail w
viewrect = Rectangle (sx + fromIntegral gl) (sy + fromIntegral gt)