mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-28 02:31:51 -07:00
ManageHelpers: add isDialog
This commit is contained in:
@@ -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'.
|
||||
|
Reference in New Issue
Block a user