aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Marking.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-04-13 18:29:27 -0600
committerJosh Rahm <rahm@google.com>2022-04-13 18:29:27 -0600
commitc92cd07aaf7c54cd528166fc46dbade8008f5392 (patch)
tree83259648e707daf4ecb357a7e2e19968fac2bf28 /src/Rahm/Desktop/Marking.hs
parent0dfe872da02d5d63eb2b334decd3a8292aff3ca3 (diff)
downloadrde-c92cd07aaf7c54cd528166fc46dbade8008f5392.tar.gz
rde-c92cd07aaf7c54cd528166fc46dbade8008f5392.tar.bz2
rde-c92cd07aaf7c54cd528166fc46dbade8008f5392.zip
[WIP] Working on better workspaces
Diffstat (limited to 'src/Rahm/Desktop/Marking.hs')
-rw-r--r--src/Rahm/Desktop/Marking.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Rahm/Desktop/Marking.hs b/src/Rahm/Desktop/Marking.hs
index 8ca50fd..1144ad7 100644
--- a/src/Rahm/Desktop/Marking.hs
+++ b/src/Rahm/Desktop/Marking.hs
@@ -94,7 +94,7 @@ instance ExtensionClass MarkState where
changeHistory :: (History Spot -> History Spot) -> (MarkState -> MarkState)
changeHistory fn ms = ms { windowHistory = fn (windowHistory ms)}
-withMaybeFocused :: (Maybe Window -> X ()) -> X ()
+withMaybeFocused :: (Maybe Window -> X a) -> X a
withMaybeFocused f = withWindowSet $ f . peek
normalizeWindows :: X ()
@@ -118,7 +118,7 @@ markCurrentWindow mark = do
markStateMap = Map.insert mark win ms
}
-pushHistory :: X () -> X ()
+pushHistory :: X a -> X a
pushHistory fn = do
withMaybeFocused $ \maybeWindowBefore -> do
case maybeWindowBefore of
@@ -128,7 +128,7 @@ pushHistory fn = do
withWindowSet $ \ws ->
XS.modify $ changeHistory (historyPush (TagSpot (currentTag ws)))
- fn
+ ret <- fn
withMaybeFocused $ \maybeWindowAfter ->
case maybeWindowAfter of
@@ -138,6 +138,8 @@ pushHistory fn = do
withWindowSet $ \ws ->
XS.modify $ changeHistory (historyPush $ TagSpot $ currentTag ws)
+ return ret
+
withHistory :: (History Spot -> X ()) -> X ()
withHistory fn = do
MarkState { windowHistory = w } <- XS.get