diff options
author | Dmitry Astapov <dastapov@gmail.com> | 2009-06-21 21:46:52 +0200 |
---|---|---|
committer | Dmitry Astapov <dastapov@gmail.com> | 2009-06-21 21:46:52 +0200 |
commit | a00440a6bf516b55929795dc69a10352bb0dbb6a (patch) | |
tree | 4056c17eda946a852b4cd11fa26d6e71311fbdc2 /XMonad | |
parent | a0c7989fdfcbe3a1238e48fa4d3a10fa05fc8098 (diff) | |
download | XMonadContrib-a00440a6bf516b55929795dc69a10352bb0dbb6a.tar.gz XMonadContrib-a00440a6bf516b55929795dc69a10352bb0dbb6a.tar.xz XMonadContrib-a00440a6bf516b55929795dc69a10352bb0dbb6a.zip |
Provide means to find original window by its decoration.
Ignore-this: fad8cb7fb4c2785b14b97d48f19604cc
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.
darcs-hash:20090621194652-5701e-3fe157f99b1ea31377b0d77db4fd3a0314b553fd.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad/Layout/Decoration.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/XMonad/Layout/Decoration.hs b/XMonad/Layout/Decoration.hs index 776108f..5c94f12 100644 --- a/XMonad/Layout/Decoration.hs +++ b/XMonad/Layout/Decoration.hs @@ -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 |