diff options
-rw-r--r-- | Operations.hs | 5 | ||||
-rw-r--r-- | XMonad.hs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Operations.hs b/Operations.hs index 62e007c..36f82e9 100644 --- a/Operations.hs +++ b/Operations.hs @@ -423,9 +423,8 @@ instance LayoutClass Tall a where doLayout (Tall nmaster _ frac) r = return . (\x->(x,Nothing)) . ap zip (tile frac r nmaster . length) . W.integrate - handleMessage (Tall nmaster delta frac) m = - return $ msum [fmap resize (fromMessage m) - ,fmap incmastern (fromMessage m)] + pureMessage (Tall nmaster delta frac) m = msum [fmap resize (fromMessage m) + ,fmap incmastern (fromMessage m)] where resize Shrink = Tall nmaster delta (max 0 $ frac-delta) resize Expand = Tall nmaster delta (min 1 $ frac+delta) incmastern (IncMasterN d) = Tall (max 0 (nmaster+d)) delta frac @@ -160,7 +160,9 @@ class (Show (layout a), Read (layout a)) => LayoutClass layout a where pureLayout _ r s = [(focus s, r)] handleMessage :: layout a -> SomeMessage -> X (Maybe (layout a)) - handleMessage _ _ = return Nothing + handleMessage l = return . pureMessage l + pureMessage :: layout a -> SomeMessage -> Maybe (layout a) + pureMessage _ _ = Nothing description :: layout a -> String description = show |