mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-04 22:21:56 -07:00
Operations.screenWorkspace: return Nothing when the screen does not exist
This commit is contained in:
@@ -163,7 +163,7 @@ keys = M.fromList $
|
|||||||
-- mod-{w,e,r} @@ Switch to physical/Xinerama screens 1, 2, or 3
|
-- 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
|
-- 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..]
|
| (key, sc) <- zip [xK_w, xK_e, xK_r] [0..]
|
||||||
, (f, m) <- [(view, 0), (shift, shiftMask)]]
|
, (f, m) <- [(view, 0), (shift, shiftMask)]]
|
||||||
|
|
||||||
|
@@ -439,9 +439,9 @@ splitVerticallyBy f = (mirrorRect *** mirrorRect) . splitHorizontallyBy f . mirr
|
|||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- Utilities
|
-- Utilities
|
||||||
|
|
||||||
-- | Return workspace visible on screen 'sc', or 0.
|
-- | Return workspace visible on screen 'sc', or Nothing.
|
||||||
screenWorkspace :: ScreenId -> X WorkspaceId
|
screenWorkspace :: ScreenId -> X (Maybe WorkspaceId)
|
||||||
screenWorkspace sc = withWindowSet $ return . fromMaybe 0 . W.lookupWorkspace sc
|
screenWorkspace sc = withWindowSet $ return . W.lookupWorkspace sc
|
||||||
|
|
||||||
-- | Apply an X operation to the currently focused window, if there is one.
|
-- | Apply an X operation to the currently focused window, if there is one.
|
||||||
withFocused :: (Window -> X ()) -> X ()
|
withFocused :: (Window -> X ()) -> X ()
|
||||||
|
Reference in New Issue
Block a user