From 48dd33e3e3da47cd3ca7e24303da9b130b7388b6 Mon Sep 17 00:00:00 2001 From: Roman Cheplyaka Date: Sat, 15 Nov 2008 11:45:25 +0100 Subject: WindowProperties: added allWithProperty darcs-hash:20081115104525-3ebed-19b3392f2bcc128da265bd7ca34c508d913383b7.gz --- XMonad/Util/WindowProperties.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'XMonad/Util/WindowProperties.hs') diff --git a/XMonad/Util/WindowProperties.hs b/XMonad/Util/WindowProperties.hs index 87715a6..226908d 100644 --- a/XMonad/Util/WindowProperties.hs +++ b/XMonad/Util/WindowProperties.hs @@ -14,10 +14,11 @@ module XMonad.Util.WindowProperties ( -- * Usage -- $usage - Property(..), hasProperty, focusedHasProperty) + Property(..), hasProperty, focusedHasProperty, allWithProperty) where import XMonad import qualified XMonad.StackSet as W +import Control.Monad -- $usage -- This module allows to specify window properties, such as title, classname or @@ -59,3 +60,8 @@ focusedHasProperty p = do Just s -> hasProperty p $ W.focus s Nothing -> return False +allWithProperty :: Property -> X [Window] +allWithProperty prop = withDisplay $ \dpy -> do + rootw <- asks theRoot + (_,_,wins) <- io $ queryTree dpy rootw + hasProperty prop `filterM` wins -- cgit v1.2.3