summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2008-05-07 03:31:22 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2008-05-07 03:31:22 +0200
commit9dea76265da2672eb200c2e7b1b5ab96ef7cb987 (patch)
tree4db4ef4563a4ec97f638cad780bb1c8df5c5951d /XMonad
parent87aafc7442d37ad7ead75dbba75c5bea000962be (diff)
downloadmetatile-9dea76265da2672eb200c2e7b1b5ab96ef7cb987.tar
metatile-9dea76265da2672eb200c2e7b1b5ab96ef7cb987.zip
Comments
darcs-hash:20080507013122-a5988-e04061b89044fd2139ddfe0db3ba32b7739202b6
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Layout.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/XMonad/Layout.hs b/XMonad/Layout.hs
index 3d9ce0a..8e5dc95 100644
--- a/XMonad/Layout.hs
+++ b/XMonad/Layout.hs
@@ -141,14 +141,20 @@ infixr 5 |||
-- | A layout that allows users to switch between various layout options.
data Choose l r a = Choose LR (l a) (r a) deriving (Read, Show)
+-- | Are we on the left or right sub-layout?
data LR = L | R deriving (Read, Show, Eq)
data NextNoWrap = NextNoWrap deriving (Eq, Show, Typeable)
instance Message NextNoWrap
+-- | A small wrapper around handleMessage, as it is tedious to write
+-- SomeMessage repeatedly.
handle :: (LayoutClass l a, Message m) => l a -> m -> X (Maybe (l a))
handle l m = handleMessage l (SomeMessage m)
+-- | A smart constructor that takes some potential modifications, returns a
+-- new structure if any fields have changed, and performs any necessary cleanup
+-- on newly non-visible layouts.
choose :: (LayoutClass l a, LayoutClass r a)
=> Choose l r a-> LR -> Maybe (l a) -> Maybe (r a) -> X (Maybe (Choose l r a))
choose (Choose d _ _) d' Nothing Nothing | d == d' = return Nothing