summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-07-08 00:38:42 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-07-08 00:38:42 +0200
commitc3e0b457f5d62e675ea1d33288b4f47b712177c4 (patch)
tree14e250e24c30ab30fd39607f7d0a34df6af880ca
parentfe2f8617e49c4fede0edd042274e519580a04f38 (diff)
downloadmetatile-c3e0b457f5d62e675ea1d33288b4f47b712177c4.tar
metatile-c3e0b457f5d62e675ea1d33288b4f47b712177c4.zip
Operations.screenWorkspace: return Nothing when the screen does not exist
darcs-hash:20070707223842-a5988-7cd70e25326d577a30279c976ae64bce3f70f2df
-rw-r--r--Config.hs2
-rw-r--r--Operations.hs6
2 files changed, 4 insertions, 4 deletions
diff --git a/Config.hs b/Config.hs
index 655d654..579a598 100644
--- a/Config.hs
+++ b/Config.hs
@@ -163,7 +163,7 @@ keys = M.fromList $
-- mod-{w,e,r} @@ Switch to physical/Xinerama screens 1, 2, or 3
-- mod-shift-{w,e,r} @@ Move client to screen 1, 2, or 3
++
- [((m .|. modMask, key), screenWorkspace sc >>= f)
+ [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust f)
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
, (f, m) <- [(view, 0), (shift, shiftMask)]]
diff --git a/Operations.hs b/Operations.hs
index 0a8bd31..68524f1 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -439,9 +439,9 @@ splitVerticallyBy f = (mirrorRect *** mirrorRect) . splitHorizontallyBy f . mirr
------------------------------------------------------------------------
-- Utilities
--- | Return workspace visible on screen 'sc', or 0.
-screenWorkspace :: ScreenId -> X WorkspaceId
-screenWorkspace sc = withWindowSet $ return . fromMaybe 0 . W.lookupWorkspace sc
+-- | Return workspace visible on screen 'sc', or Nothing.
+screenWorkspace :: ScreenId -> X (Maybe WorkspaceId)
+screenWorkspace sc = withWindowSet $ return . W.lookupWorkspace sc
-- | Apply an X operation to the currently focused window, if there is one.
withFocused :: (Window -> X ()) -> X ()