aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util
diff options
context:
space:
mode:
authorRoman Cheplyaka <roma@ro-che.info>2008-11-15 11:45:25 +0100
committerRoman Cheplyaka <roma@ro-che.info>2008-11-15 11:45:25 +0100
commit48dd33e3e3da47cd3ca7e24303da9b130b7388b6 (patch)
treee54ebaa094ecb0ad73c520cf0bb287cf75597c1b /XMonad/Util
parent08a24084162aebd899cbf2b8437e61f98b914902 (diff)
downloadXMonadContrib-48dd33e3e3da47cd3ca7e24303da9b130b7388b6.tar.gz
XMonadContrib-48dd33e3e3da47cd3ca7e24303da9b130b7388b6.tar.xz
XMonadContrib-48dd33e3e3da47cd3ca7e24303da9b130b7388b6.zip
WindowProperties: added allWithProperty
darcs-hash:20081115104525-3ebed-19b3392f2bcc128da265bd7ca34c508d913383b7.gz
Diffstat (limited to 'XMonad/Util')
-rw-r--r--XMonad/Util/WindowProperties.hs8
1 files changed, 7 insertions, 1 deletions
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