xmonad-contrib-0.18.0: 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 | Safe-Inferred
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 Source #

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

Constructors

FocusTracking (Maybe Window) |

#### Instances

Instances details

LayoutModifier FocusTracking Window Source # |

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)) Source #

modifyLayoutWithUpdate :: LayoutClass l Window => FocusTracking Window -> Workspace WorkspaceId (l Window) Window -> Rectangle -> X (([(Window, Rectangle)], Maybe (l Window)), Maybe (FocusTracking Window)) Source #

handleMess :: FocusTracking Window -> SomeMessage -> X (Maybe (FocusTracking Window)) Source #

handleMessOrMaybeModifyIt :: FocusTracking Window -> SomeMessage -> X (Maybe (Either (FocusTracking Window) SomeMessage)) Source #

pureMess :: FocusTracking Window -> SomeMessage -> Maybe (FocusTracking Window) Source #

redoLayout :: FocusTracking Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> X ([(Window, Rectangle)], Maybe (FocusTracking Window)) Source #

pureModifier :: FocusTracking Window -> Rectangle -> Maybe (Stack Window) -> [(Window, Rectangle)] -> ([(Window, Rectangle)], Maybe (FocusTracking Window)) Source #

hook :: FocusTracking Window -> X () Source #

unhook :: FocusTracking Window -> X () Source #

modifierDescription :: FocusTracking Window -> String Source #

modifyDescription :: LayoutClass l Window => FocusTracking Window -> l Window -> String Source #

Read (FocusTracking a) Source # |
Instance details Defined in XMonad.Layout.FocusTracking Methods readsPrec :: Int -> ReadS (FocusTracking a) Source # readList :: ReadS [FocusTracking a] Source # readPrec :: ReadPrec (FocusTracking a) Source # readListPrec :: ReadPrec [FocusTracking a] Source #
Show (FocusTracking a) Source # |
Instance details Defined in XMonad.Layout.FocusTracking Methods showsPrec :: Int -> FocusTracking a -> ShowS Source # show :: FocusTracking a -> String Source # showList :: [FocusTracking a] -> ShowS Source #

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

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