From 26b6c952ff6c61b29cb2c4f38f91f1dc3bc4220b Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Sat, 31 Oct 2009 16:49:45 +0100 Subject: 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 --- XMonad/Util/WindowProperties.hs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'XMonad/Util/WindowProperties.hs') 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 -- cgit v1.2.3