summaryrefslogtreecommitdiffstats
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
commit6e231ff7825e1d8120a6f3896418b3840024a040 (patch)
tree70e5fc8c8ba8726da33fade7dea922ad3e867a53
parentfabdf6a026b61e0602c86a7402dfafa47a9c2154 (diff)
downloadmetatile-6e231ff7825e1d8120a6f3896418b3840024a040.tar
metatile-6e231ff7825e1d8120a6f3896418b3840024a040.zip
Move workspace fetching logic from Config.hs to Operations.hs
darcs-hash:20070410064714-a5988-e9b1fac201a546d1722db41213efc81223007e43
-rw-r--r--Config.hs2
-rw-r--r--Operations.hs4
2 files changed, 5 insertions, 1 deletions
diff --git a/Config.hs b/Config.hs
index be28d1f..9b2d2f5 100644
--- a/Config.hs
+++ b/Config.hs
@@ -136,7 +136,7 @@ keys = M.fromList $
-- Keybindings to each screen :
-- mod-wer (underneath 123) switches to physical/Xinerama screens 1 2 and 3
++
- [((m .|. modMask, key), gets workspace >>= f . (+1) . fromMaybe 0 . W.workspace sc)
+ [((m .|. modMask, key), screenWorkspace sc >>= f)
| (key, sc) <- zip [xK_s, xK_d, xK_f] [0..]
, (f, m) <- [(view, 0), (tag, shiftMask)]]
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)