From e376a7edcaeb784a5311973bf2b0f447d7eb6242 Mon Sep 17 00:00:00 2001 From: johanngiwer Date: Fri, 9 Jan 2009 00:25:05 +0100 Subject: ManageHelpers: add isDialog darcs-hash:20090108232505-63708-066fa172915765b3980dc0ee080aff53bc8b3192.gz --- XMonad/Hooks/ManageHelpers.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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'. -- cgit v1.2.3