aboutsummaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-04-10 08:47:14 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-04-10 08:47:14 +0200
commit61c654615dc4cf624ecd7b9454c85833ee9e618d (patch)
tree70e5fc8c8ba8726da33fade7dea922ad3e867a53 /Operations.hs
parente4ddfe82216e94a641fd4677be6acc94d82c6a17 (diff)
downloadxmonad-61c654615dc4cf624ecd7b9454c85833ee9e618d.tar.gz
xmonad-61c654615dc4cf624ecd7b9454c85833ee9e618d.tar.xz
xmonad-61c654615dc4cf624ecd7b9454c85833ee9e618d.zip
Move workspace fetching logic from Config.hs to Operations.hs
darcs-hash:20070410064714-a5988-e9b1fac201a546d1722db41213efc81223007e43.gz
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Operations.hs b/Operations.hs
index 86d6da1..01585e4 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -238,6 +238,10 @@ view o = do
setTopFocus
where n = o-1
+-- | 'screenWorkspace sc' returns the workspace number viewed by 'sc'.
+screenWorkspace :: Int -> X Int
+screenWorkspace sc = fmap (succ . fromMaybe 0 . W.workspace sc) (gets workspace)
+
-- | True if window is under management by us
isClient :: Window -> X Bool
isClient w = liftM (W.member w) (gets workspace)