diff options
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 |