aboutsummaryrefslogtreecommitdiff
path: root/src/Internal
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2020-02-03 15:00:23 -0700
committerJosh Rahm <rahm@google.com>2020-02-03 15:00:23 -0700
commite3b47c680b20aab1e703ce0525364244422c27e8 (patch)
treee5739ea41f403e48d4d47860f1efb337b4dfc3d0 /src/Internal
parenta153456b06a06db97735284a0d7496017799807a (diff)
downloadrde-e3b47c680b20aab1e703ce0525364244422c27e8.tar.gz
rde-e3b47c680b20aab1e703ce0525364244422c27e8.tar.bz2
rde-e3b47c680b20aab1e703ce0525364244422c27e8.zip
More minor aesthetic changes to XMobar
Diffstat (limited to 'src/Internal')
-rw-r--r--src/Internal/Keys.hs3
-rw-r--r--src/Internal/Marking.hs30
2 files changed, 18 insertions, 15 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs
index 8ec06b6..3d0df0c 100644
--- a/src/Internal/Keys.hs
+++ b/src/Internal/Keys.hs
@@ -27,7 +27,8 @@ newKeys =
zip ['1'..] (XMonad.workspaces config)
gotoWorkspace :: Char -> X ()
- gotoWorkspace ch =
+ gotoWorkspace ch = do
+ saveLastMark markContext
mapM_ (windows . W.greedyView) (Map.lookup ch workspacesByInt)
in
diff --git a/src/Internal/Marking.hs b/src/Internal/Marking.hs
index 352131b..e5cf696 100644
--- a/src/Internal/Marking.hs
+++ b/src/Internal/Marking.hs
@@ -54,24 +54,26 @@ markCurrentWindow (MarkContext ioref) mark = do
saveMarkState =<< liftIO (readIORef ioref)
-jumpToLast :: MarkContext -> X ()
-jumpToLast (MarkContext ioref) = do
+saveLastMark :: MarkContext -> X ()
+saveLastMark (MarkContext ioref) =
withFocused $ \win -> do
- m <- markLast <$> (liftIO $ readIORef ioref)
- liftIO $ modifyIORef ioref (\state -> state { markLast = Just win })
- mapM_ focus m
+ liftIO $ modifyIORef ioref (\state -> state { markLast = Just win })
+
+jumpToLast :: MarkContext -> X ()
+jumpToLast ctx@(MarkContext ioref) = do
+ m <- markLast <$> (liftIO $ readIORef ioref)
+ saveLastMark ctx
+ mapM_ focus m
saveMarkState =<< liftIO (readIORef ioref)
jumpToMark :: MarkContext -> Mark -> X ()
-jumpToMark (MarkContext ioref) mark = do
- withFocused $ \win -> do
- MarkState {markStateMap = m} <- liftIO $ readIORef ioref
- case Map.lookup mark m of
- Nothing -> return ()
- Just w -> do
- liftIO $ modifyIORef ioref $ \state ->
- state { markLast = Just win }
- focus w
+jumpToMark ctx@(MarkContext ioref) mark = do
+ MarkState {markStateMap = m} <- liftIO $ readIORef ioref
+ case Map.lookup mark m of
+ Nothing -> return ()
+ Just w -> do
+ saveLastMark ctx
+ focus w
saveMarkState =<< liftIO (readIORef ioref)