XMonad.Layout.FocusTracking

xmonad-contrib-0.18.1: Community-maintained extensions for xmonad

Copyright | (c) 2010 & 2013 Adam Vogt 2011 Willem Vanlint 2018 & 2022 L.S.Leary
License | BSD-style (see xmonad/LICENSE)
Maintainer | @LSLeary (on github)
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell2010

XMonad.Layout.FocusTracking

Contents

- Usage

Description

FocusTracking simply holds onto the last true focus it was given and continues to use it as the focus for the transformed layout until it sees another. It can be used to improve the behaviour of a child layout that has not been given the focused window, or equivalently, that of the layout itself when a float has focus.

Relevant issues:

- http://code.google.com/p/xmonad/issues/detail?id=4
- http://code.google.com/p/xmonad/issues/detail?id=306
- -------------------------------------------------------------------------------

Synopsis

- newtype FocusTracking a = FocusTracking (Maybe Window)
- focusTracking :: l a -> ModifiedLayout FocusTracking l a

# Usage

To use the module, first import it:

    import XMonad.Layout.FocusTracking

Then, a focus-dependent layout can be made to fall back on the last focus it saw, for example:

    main = xmonad def
     { layoutHook = someParentLayoutWith aChild (focusTracking anotherChild)
     , ...
     }

Or in a simpler case:

    main = xmonad def
     { layoutHook = myTiledLayout ||| focusTracking Full
     , ...
     }

newtype FocusTracking a #

A `LayoutModifier` that remembers the last focus it saw.

Constructors

FocusTracking (Maybe Window) |

#### Instances

Instances details

LayoutModifier FocusTracking Window # |
Instance details Defined in XMonad.Layout.FocusTracking Methods modifyLayout :: LayoutClass l Window => FocusTracking Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X ([(Window, Rectangle)], Maybe (l Window)) # modifyLayoutWithUpdate :: LayoutClass l Window => FocusTracking Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (FocusTracking Window)) # handleMess :: FocusTracking Window -> SomeMessage -> X (Maybe (FocusTracking Window)) # handleMessOrMaybeModifyIt :: FocusTracking Window -> SomeMessage -> X (Maybe (Either (FocusTracking Window) SomeMessage)) # pureMess :: FocusTracking Window -> SomeMessage -> Maybe (FocusTracking Window) # redoLayout :: FocusTracking Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (FocusTracking Window)) # pureModifier :: FocusTracking Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (FocusTracking Window)) # hook :: FocusTracking Window -> X () # unhook :: FocusTracking Window -> X () # modifierDescription :: FocusTracking Window -> String # modifyDescription :: LayoutClass l Window => FocusTracking Window -> l Window -> String #
Read (FocusTracking a) # |
Instance details Defined in XMonad.Layout.FocusTracking Methods readsPrec :: Int -> ReadS (FocusTracking a) # readList :: ReadS [FocusTracking a] # readPrec :: ReadPrec (FocusTracking a) # readListPrec :: ReadPrec [FocusTracking a] #
Show (FocusTracking a) # |
Instance details Defined in XMonad.Layout.FocusTracking Methods showsPrec :: Int -> FocusTracking a -> ShowS # show :: FocusTracking a -> String # showList :: [FocusTracking a] -> ShowS #

focusTracking :: l a -> ModifiedLayout FocusTracking l a #

Transform a layout into one that remembers and uses the last focus it saw.