From 1e67a3f13c5ff800ebc6756deee22abb2e4fc6ba Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Sun, 5 Oct 2008 21:02:20 +0200 Subject: Merge emptyLayoutMod into redoLayout This removes the emptyLayoutMod method from the LayoutModifier class, and change the Stack parameter to redoLayout to a Maybe Stack one. It also changes all affected code. This should should be a refactoring without any change in program behaviour. darcs-hash:20081005190220-23c07-4701517e3433ecff8c999da75ac582f6f1b65c19.gz --- XMonad/Layout/Decoration.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'XMonad/Layout/Decoration.hs') diff --git a/XMonad/Layout/Decoration.hs b/XMonad/Layout/Decoration.hs index 2fad139..c17d71c 100644 --- a/XMonad/Layout/Decoration.hs +++ b/XMonad/Layout/Decoration.hs @@ -201,7 +201,12 @@ instance Eq a => DecorationStyle DefaultDecoration a -- 'handleEvent', which will call the appropriate 'DecorationStyle' -- methods to perform its tasks. instance (DecorationStyle ds Window, Shrinker s) => LayoutModifier (Decoration ds s) Window where - redoLayout (Decoration st sh t ds) sc stack wrs + redoLayout (Decoration (I (Just s)) sh t ds) _ Nothing _ = do + releaseResources s + return ([], Just $ Decoration (I Nothing) sh t ds) + redoLayout _ _ Nothing _ = return ([], Nothing) + + redoLayout (Decoration st sh t ds) sc (Just stack) wrs | I Nothing <- st = initState t ds sc stack wrs >>= processState | I (Just s) <- st = do let dwrs = decos s (d,a) = curry diff (get_ws dwrs) ws @@ -264,11 +269,6 @@ instance (DecorationStyle ds Window, Shrinker s) => LayoutModifier (Decoration d return $ Just $ Decoration (I Nothing) sh t ds handleMess _ _ = return Nothing - emptyLayoutMod (Decoration (I (Just s)) sh t ds) _ _ = do - releaseResources s - return ([], Just $ Decoration (I Nothing) sh t ds) - emptyLayoutMod _ _ _ = return ([], Nothing) - modifierDescription (Decoration _ _ _ ds) = describeDeco ds -- | By default 'Decoration' handles 'PropertyEvent' and 'ExposeEvent' -- cgit v1.2.3