diff options
author | johanngiwer <johanngiwer@web.de> | 2009-01-09 00:25:05 +0100 |
---|---|---|
committer | johanngiwer <johanngiwer@web.de> | 2009-01-09 00:25:05 +0100 |
commit | e376a7edcaeb784a5311973bf2b0f447d7eb6242 (patch) | |
tree | 7437c15ba78cb7c7165d75ade2419cfc7fa4eec1 /XMonad/Hooks | |
parent | 758589052566d5995ea50e07bd9e860af49171f2 (diff) | |
download | XMonadContrib-e376a7edcaeb784a5311973bf2b0f447d7eb6242.tar.gz XMonadContrib-e376a7edcaeb784a5311973bf2b0f447d7eb6242.tar.xz XMonadContrib-e376a7edcaeb784a5311973bf2b0f447d7eb6242.zip |
ManageHelpers: add isDialog
darcs-hash:20090108232505-63708-066fa172915765b3980dc0ee080aff53bc8b3192.gz
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'. |