mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
Provide means to find original window by its decoration.
In order to enable user to write custom `decorationMouseFocusHook' and `decorationMouseDragHook' hooks we need to provide him with means to lookup original window by its decoration. Module Decoration has internal function `lookFor' for exactly the same purpose. I exported it under a slightly different name and without exposing internals of DecorationState.
This commit is contained in:
@@ -26,6 +26,7 @@ module XMonad.Layout.Decoration
|
||||
, Shrinker (..), DefaultShrinker
|
||||
, shrinkText, CustomShrink ( CustomShrink ), shrinkWhile
|
||||
, isInStack, isVisible, isInvisible, isWithin, fi
|
||||
, findWindowByDecoration
|
||||
, module XMonad.Layout.LayoutModifier
|
||||
) where
|
||||
|
||||
@@ -307,6 +308,9 @@ lookFor w ((wr,(Just dw,dr)):dwrs) | w == dw = Just (wr,(dw,dr))
|
||||
lookFor w ((_, (Nothing, _)):dwrs) = lookFor w dwrs
|
||||
lookFor _ [] = Nothing
|
||||
|
||||
findWindowByDecoration :: Window -> DecorationState -> Maybe (OrigWin,(Window,Maybe Rectangle))
|
||||
findWindowByDecoration w ds = lookFor w (decos ds)
|
||||
|
||||
-- | Initialize the 'DecorationState' by initializing the font
|
||||
-- structure and by creating the needed decorations.
|
||||
initState :: DecorationStyle ds Window => Theme -> ds Window -> Rectangle
|
||||
|
Reference in New Issue
Block a user