| 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
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
| LayoutModifier FocusTracking Window Source # | |
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 # | |
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) Source # | |
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 Source #
Transform a layout into one that remembers and uses the last focus it saw.