aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Marking.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-11-15 16:48:28 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:45 -0600
commit7852e8c0adccc301e4927b7d72f1df86cb71a278 (patch)
tree152dec8460e6d06f54958b4f522713e8432f94bc /src/Internal/Marking.hs
parent349be728078137e48731a4a0a33ef8459040fc2f (diff)
downloadrde-7852e8c0adccc301e4927b7d72f1df86cb71a278.tar.gz
rde-7852e8c0adccc301e4927b7d72f1df86cb71a278.tar.bz2
rde-7852e8c0adccc301e4927b7d72f1df86cb71a278.zip
Change marking to use greedy viewing.
Diffstat (limited to 'src/Internal/Marking.hs')
-rw-r--r--src/Internal/Marking.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Internal/Marking.hs b/src/Internal/Marking.hs
index fc1c082..c1234ec 100644
--- a/src/Internal/Marking.hs
+++ b/src/Internal/Marking.hs
@@ -1,7 +1,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
module Internal.Marking where
-import Internal.Windows (mapWindows)
+import Internal.Windows (mapWindows, findWindow, getLocationWorkspace)
import XMonad
import XMonad.StackSet hiding (focus)
import Data.IORef
@@ -30,6 +30,13 @@ data MarkState =
instance ExtensionClass MarkState where
initialValue = MarkState Map.empty Nothing
+greedyFocus :: Window -> X ()
+greedyFocus win = do
+ ws <- withWindowSet $ \ss ->
+ return $ getLocationWorkspace =<< findWindow ss win
+ mapM_ (windows . greedyView . tag) ws
+ focus win
+
markCurrentWindow :: Mark -> X ()
markCurrentWindow mark = do
withFocused $ \win ->
@@ -47,7 +54,7 @@ jumpToLast :: X ()
jumpToLast = do
m <- markLast <$> XS.get
saveLastMark
- mapM_ focus m
+ mapM_ greedyFocus m
jumpToMark :: Mark -> X ()
jumpToMark mark = do
@@ -56,7 +63,7 @@ jumpToMark mark = do
Nothing -> return ()
Just w -> do
saveLastMark
- focus w
+ greedyFocus w
setFocusedWindow :: a -> StackSet i l a s sd -> StackSet i l a s sd
setFocusedWindow