diff options
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r-- | XMonad/Hooks/ManageHelpers.hs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/XMonad/Hooks/ManageHelpers.hs b/XMonad/Hooks/ManageHelpers.hs index ab568eb..5dd8e32 100644 --- a/XMonad/Hooks/ManageHelpers.hs +++ b/XMonad/Hooks/ManageHelpers.hs @@ -30,6 +30,7 @@ module XMonad.Hooks.ManageHelpers ( (-?>), (/=?), (<==?), (</=?), (-->>), (-?>>), isKDETrayWindow, isFullscreen, + isDialog, transientTo, maybeToDefinite, MaybeManageHook, @@ -132,6 +133,17 @@ isFullscreen = ask >>= \w -> liftX $ do Just xs -> fromIntegral full `elem` xs _ -> False +-- | A predicate to check whether a window is a dialog. +isDialog :: Query Bool +isDialog = ask >>= \w -> liftX $ do + dpy <- asks display + w_type <- getAtom "_NET_WM_WINDOW_TYPE" + w_dialog <- getAtom "_NET_WM_WINDOW_TYPE_DIALOG" + r <- io $ getWindowProperty32 dpy w_type w + return $ case r of + Just xs -> fromIntegral w_dialog `elem` xs + _ -> False + -- | A predicate to check whether a window is Transient. -- It holds the result which might be the window it is transient to -- or it might be 'Nothing'. |