aboutsummaryrefslogtreecommitdiffstats
path: root/Combo.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-06-16 21:10:52 +0200
committerDavid Roundy <droundy@darcs.net>2007-06-16 21:10:52 +0200
commita2a38d2897f8324d024d1f73e277133edfa00b91 (patch)
treeb4e7c6f309fa6153ab06b2fe7cab29240db8d928 /Combo.hs
parent9782aefe2447f52d2e45f42c0c2ae7dec55e8539 (diff)
downloadXMonadContrib-a2a38d2897f8324d024d1f73e277133edfa00b91.tar.gz
XMonadContrib-a2a38d2897f8324d024d1f73e277133edfa00b91.tar.xz
XMonadContrib-a2a38d2897f8324d024d1f73e277133edfa00b91.zip
fix leak in Combo.
We leaked decorations, since UnDoLayout wasn't passed to the actual layouts that had decorations attached. :( darcs-hash:20070616191052-72aca-9a2e2315e11257f5e5e35cd3944e2a4092919c74.gz
Diffstat (limited to 'Combo.hs')
-rw-r--r--Combo.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Combo.hs b/Combo.hs
index 6b29ae8..bdefcb3 100644
--- a/Combo.hs
+++ b/Combo.hs
@@ -20,6 +20,7 @@ module XMonadContrib.Combo (
import XMonad
import StackSet ( integrate, differentiate )
+import Operations ( UnDoLayout(UnDoLayout) )
-- $usage
--
@@ -47,7 +48,15 @@ combo origls super = Layout { doLayout = \r s -> arrange r (integrate s), modify
(map differentiate $
wss (take (length rs) $ map snd origls) origws)
return $ concat out
+ message m | Just UnDoLayout <- fromMessage m =
+ do (super':ls') <- broadcastPrivate UnDoLayout (super:map fst origls)
+ return $ Just $ combo (zip ls' $ map snd origls) super'
message m = do msuper' <- modifyLayout super m
case msuper' of
Nothing -> return Nothing
Just super' -> return $ Just $ combo origls super'
+
+broadcastPrivate :: Message a => a -> [Layout] -> X [Layout]
+broadcastPrivate a ol = mapM f ol
+ where f l = do ml' <- modifyLayout l (SomeMessage a) `catchX` return (Just l)
+ return $ maybe l id ml'