aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-03-12 02:23:50 +0100
committerDon Stewart <dons@cse.unsw.edu.au>2007-03-12 02:23:50 +0100
commit4db33f6d9801259f94294044b427cb9c76ae0b45 (patch)
treeae41b4fdca1326c1abe26071c6f422cd4b067a5d
parentdce39303b4534701227dd1a71bc26a8665b081f3 (diff)
downloadxmonad-4db33f6d9801259f94294044b427cb9c76ae0b45.tar.gz
xmonad-4db33f6d9801259f94294044b427cb9c76ae0b45.tar.xz
xmonad-4db33f6d9801259f94294044b427cb9c76ae0b45.zip
comments, move isRoot into XMonad
darcs-hash:20070312012350-9c5c1-1753dcb9d066d8954fe5d2f2ed8f5d06a6f976aa.gz
-rw-r--r--Main.hs4
-rw-r--r--XMonad.hs14
2 files changed, 12 insertions, 6 deletions
diff --git a/Main.hs b/Main.hs
index c023853..8091714 100644
--- a/Main.hs
+++ b/Main.hs
@@ -270,10 +270,6 @@ setTopFocus = do
Just new -> setFocus new
Nothing -> gets theRoot >>= setFocus
--- | True if the given window is the root window
-isRoot :: Window -> X Bool
-isRoot w = liftM (w==) (gets theRoot)
-
-- | raise. focus to window at offset 'n' in list.
-- The currently focused window is always the head of the list
raise :: Ordering -> X ()
diff --git a/XMonad.hs b/XMonad.hs
index 8e03d78..24c7899 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -15,7 +15,9 @@
--
module XMonad (
- X, WorkSpace, XState(..),runX, withDisplay, io, spawn, trace, whenJust
+ X, WorkSpace, XState(..),runX,
+ io, withDisplay, isRoot,
+ spawn, trace, whenJust
) where
import StackSet (StackSet)
@@ -49,11 +51,19 @@ newtype X a = X (StateT XState IO a)
runX :: XState -> X a -> IO ()
runX st (X a) = runStateT a st >> return ()
+-- ---------------------------------------------------------------------
+-- Convenient wrappers to state
+
-- | Run a monad action with the current display settings
withDisplay :: (Display -> X ()) -> X ()
withDisplay f = gets display >>= f
-------------------------------------------------------------------------
+-- | True if the given window is the root window
+isRoot :: Window -> X Bool
+isRoot w = liftM (w==) (gets theRoot)
+
+-- ---------------------------------------------------------------------
+-- Utilities
-- | Lift an IO action into the X monad
io :: IO a -> X a