diff options
author | Juraj Hercek <juhe_xmonad@hck.sk> | 2009-07-15 12:50:53 +0200 |
---|---|---|
committer | Juraj Hercek <juhe_xmonad@hck.sk> | 2009-07-15 12:50:53 +0200 |
commit | 984ccf48fee2ded4e758f818e53019c625e9e0d8 (patch) | |
tree | 9d102b16a41ade5d2ac8aed8df3806b2d033b3fd | |
parent | 497f37f3ed69ecebebc69c3027466ee420590aba (diff) | |
download | XMonadContrib-984ccf48fee2ded4e758f818e53019c625e9e0d8.tar.gz XMonadContrib-984ccf48fee2ded4e758f818e53019c625e9e0d8.tar.xz XMonadContrib-984ccf48fee2ded4e758f818e53019c625e9e0d8.zip |
Addition of Machine window property.
Ignore-this: d71d82bac7cc59ef462e728adaf5db01
This patch adds WM_CLIENT_MACHINE property to window properties.
I can be used to distinguish windows run from different machines.
darcs-hash:20090715105053-69f16-6c1398ca86453bcb79aedf33597f5cb279f902a2.gz
-rw-r--r-- | XMonad/Util/WindowProperties.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/XMonad/Util/WindowProperties.hs b/XMonad/Util/WindowProperties.hs index 6fcf926..e3909dc 100644 --- a/XMonad/Util/WindowProperties.hs +++ b/XMonad/Util/WindowProperties.hs @@ -38,6 +38,7 @@ data Property = Title String | ClassName String | Resource String | Role String -- ^ WM_WINDOW_ROLE property + | Machine String -- ^ WM_CLIENT_MACHINE property | And Property Property | Or Property Property | Not Property @@ -51,7 +52,8 @@ 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 (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 } @@ -79,6 +81,7 @@ propertyToQuery (Title s) = title =? s propertyToQuery (Resource s) = resource =? s propertyToQuery (ClassName s) = className =? s propertyToQuery (Role s) = stringProperty "WM_WINDOW_ROLE" =? s +propertyToQuery (Machine s) = stringProperty "WM_CLIENT_MACHINE" =? s propertyToQuery (And p1 p2) = propertyToQuery p1 <&&> propertyToQuery p2 propertyToQuery (Or p1 p2) = propertyToQuery p1 <||> propertyToQuery p2 propertyToQuery (Not p) = not `fmap` propertyToQuery p |