diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2021-11-16 22:28:00 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2021-11-16 22:28:00 -0700 |
| commit | 810cbe4acc181e3ae07a723d0da5f51dc6daa913 (patch) | |
| tree | 152dec8460e6d06f54958b4f522713e8432f94bc /src/Internal/Marking.hs | |
| parent | ec4bed82680706c055bf2a29616274e61ea9363e (diff) | |
| parent | b286c60f3c46209e61cdb5c46c5c35e2e4ad8ddb (diff) | |
| download | rde-810cbe4acc181e3ae07a723d0da5f51dc6daa913.tar.gz rde-810cbe4acc181e3ae07a723d0da5f51dc6daa913.tar.bz2 rde-810cbe4acc181e3ae07a723d0da5f51dc6daa913.zip | |
Merge branch 'v017' of josher.dev:rde into v017
Diffstat (limited to 'src/Internal/Marking.hs')
| -rw-r--r-- | src/Internal/Marking.hs | 13 |
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 |