aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Util/WindowProperties.hs
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2009-10-31 16:49:45 +0100
committerAdam Vogt <vogt.adam@gmail.com>2009-10-31 16:49:45 +0100
commit26b6c952ff6c61b29cb2c4f38f91f1dc3bc4220b (patch)
treef620ae3d9e055d42e4fa0d85b4e43b80e48ab9cf /XMonad/Util/WindowProperties.hs
parent58fcfaadf83cc655e119a292a4eb5dfe701d9574 (diff)
downloadXMonadContrib-26b6c952ff6c61b29cb2c4f38f91f1dc3bc4220b.tar.gz
XMonadContrib-26b6c952ff6c61b29cb2c4f38f91f1dc3bc4220b.tar.xz
XMonadContrib-26b6c952ff6c61b29cb2c4f38f91f1dc3bc4220b.zip
Implement hasProperty in terms of runQuery in U.WindowProperties
Ignore-this: 1c351bc436e0e323dc25d8f5ff734dcb This addresses issue 302 for unicode titles by actually using the complicated XMonad.ManageHook.title code, instead of reimplementing it with stringProperty (which doesn't appear to handle unicode). darcs-hash:20091031154945-1499c-8ffa999923416eeb052c5949beec8519fc75e5e8.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Util/WindowProperties.hs10
1 files changed, 1 insertions, 9 deletions
diff --git a/XMonad/Util/WindowProperties.hs b/XMonad/Util/WindowProperties.hs
index e3909dc..d4fe517 100644
--- a/XMonad/Util/WindowProperties.hs
+++ b/XMonad/Util/WindowProperties.hs
@@ -49,15 +49,7 @@ infixr 8 `Or`
-- | Does given window have this property?
hasProperty :: Property -> Window -> X Bool
-hasProperty (Title s) w = withDisplay $ \d -> fmap (Just s ==) $ io $ fetchName d w
-hasProperty (Resource s) w = withDisplay $ \d -> fmap ((==) s . resName ) $ io $ getClassHint d w
-hasProperty (ClassName s) w = withDisplay $ \d -> fmap ((==) s . resClass) $ io $ getClassHint d w
-hasProperty (Role s) w = withDisplay $ \d -> fmap ((==) (Just s)) $ getStringProperty d w "WM_WINDOW_ROLE"
-hasProperty (Machine s) w = withDisplay $ \d -> fmap ((==) (Just s)) $ getStringProperty d w "WM_CLIENT_MACHINE"
-hasProperty (And p1 p2) w = do { r1 <- hasProperty p1 w; r2 <- hasProperty p2 w; return $ r1 && r2 }
-hasProperty (Or p1 p2) w = do { r1 <- hasProperty p1 w; r2 <- hasProperty p2 w; return $ r1 || r2 }
-hasProperty (Not p1) w = do { r1 <- hasProperty p1 w; return $ not r1 }
-hasProperty (Const b) _ = return b
+hasProperty p w = runQuery (propertyToQuery p) w
-- | Does the focused window have this property?
focusedHasProperty :: Property -> X Bool