mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-05 22:51:52 -07:00
X.A.CycleRecentWS: Rename restoreOrder to unView
Makes it more obvious what it really does. Also, don't expose origWSet as a variable, lest someone uses it. :-)
This commit is contained in:
@@ -104,8 +104,7 @@ cycleWindowSets :: (WindowSet -> [WorkspaceId]) -- ^ A function used to create a
|
|||||||
-- If it's the same as nextOption key, it is effectively ignored.
|
-- If it's the same as nextOption key, it is effectively ignored.
|
||||||
-> X ()
|
-> X ()
|
||||||
cycleWindowSets genOptions mods keyNext keyPrev = do
|
cycleWindowSets genOptions mods keyNext keyPrev = do
|
||||||
origWSet <- gets windowset
|
(options, unView') <- gets $ (genOptions &&& unView) . windowset
|
||||||
let options = genOptions origWSet
|
|
||||||
XConf {theRoot = root, display = d} <- ask
|
XConf {theRoot = root, display = d} <- ask
|
||||||
let event = allocaXEvent $ \p -> do
|
let event = allocaXEvent $ \p -> do
|
||||||
maskEvent d (keyPressMask .|. keyReleaseMask) p
|
maskEvent d (keyPressMask .|. keyReleaseMask) p
|
||||||
@@ -114,7 +113,7 @@ cycleWindowSets genOptions mods keyNext keyPrev = do
|
|||||||
return (t, s)
|
return (t, s)
|
||||||
let setOption n = do
|
let setOption n = do
|
||||||
let nextWs = options `cycref` n
|
let nextWs = options `cycref` n
|
||||||
syncW ws = windows $ view ws . restoreOrder origWSet
|
syncW ws = windows $ view ws . unView'
|
||||||
(t, s) <- io event
|
(t, s) <- io event
|
||||||
if | t == keyPress && s == keyNext -> syncW nextWs >> setOption (n + 1)
|
if | t == keyPress && s == keyNext -> syncW nextWs >> setOption (n + 1)
|
||||||
| t == keyPress && s == keyPrev -> syncW nextWs >> setOption (n - 1)
|
| t == keyPress && s == keyPrev -> syncW nextWs >> setOption (n - 1)
|
||||||
@@ -133,8 +132,8 @@ cycleWindowSets genOptions mods keyNext keyPrev = do
|
|||||||
-- 'view' away from the old one, restore the workspace order of the
|
-- 'view' away from the old one, restore the workspace order of the
|
||||||
-- former inside of the latter. This respects any new state that the
|
-- former inside of the latter. This respects any new state that the
|
||||||
-- new 'WindowSet' may have accumulated.
|
-- new 'WindowSet' may have accumulated.
|
||||||
restoreOrder :: WindowSet -> WindowSet -> WindowSet
|
unView :: WindowSet -> WindowSet -> WindowSet
|
||||||
restoreOrder origW w
|
unView origW w
|
||||||
| -- The focused screen changed; the old focus is on a visible screen
|
| -- The focused screen changed; the old focus is on a visible screen
|
||||||
newFocT `elem` visT =
|
newFocT `elem` visT =
|
||||||
w { current = (current origW){ workspace = findFoc (workspace <$> visible w) }
|
w { current = (current origW){ workspace = findFoc (workspace <$> visible w) }
|
||||||
|
Reference in New Issue
Block a user