From a2a38d2897f8324d024d1f73e277133edfa00b91 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Sat, 16 Jun 2007 21:10:52 +0200 Subject: 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 --- Combo.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Combo.hs') 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' -- cgit v1.2.3