diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-12-13 03:17:04 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-12-13 03:17:04 +0100 |
commit | f73bde137e9737230932553586f6ad84727544de (patch) | |
tree | af52a12a587d0ddb2426f08a33b96e2654460347 | |
parent | 772561fdc3473de8063aecf7fc099782239c55f9 (diff) | |
download | XMonadContrib-f73bde137e9737230932553586f6ad84727544de.tar.gz XMonadContrib-f73bde137e9737230932553586f6ad84727544de.tar.xz XMonadContrib-f73bde137e9737230932553586f6ad84727544de.zip |
Add support for _NET_WM_STRUT_PARTIAL
darcs-hash:20071213021704-a5988-09d4118b417f1e25f1f640cc28d5e3fee5af8276.gz
-rw-r--r-- | XMonad/Hooks/ManageDocks.hs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/XMonad/Hooks/ManageDocks.hs b/XMonad/Hooks/ManageDocks.hs index 6d800d6..d256402 100644 --- a/XMonad/Hooks/ManageDocks.hs +++ b/XMonad/Hooks/ManageDocks.hs @@ -25,6 +25,8 @@ module XMonad.Hooks.ManageDocks ( import XMonad import Foreign.C.Types (CLong) import Data.Maybe (catMaybes) +import Control.Monad + -- $usage -- To use this module, add the following import to @~\/.xmonad\/xmonad.hs@: -- @@ -68,15 +70,15 @@ checkDock = ask >>= \w -> liftX $ do -- Gets the STRUT config, if present, in xmonad gap order getStrut :: Window -> X (Maybe (Int, Int, Int, Int)) getStrut w = do - a <- getAtom "_NET_WM_STRUT" - mbr <- getProp a w - case mbr of - Just [l,r,t,b] -> return (Just ( - fromIntegral t, - fromIntegral b, - fromIntegral l, - fromIntegral r)) - _ -> return Nothing + s <- getAtom "_NET_WM_STRUT" + sp <- getAtom "_NET_WM_STRUT_PARTIAL" + liftM2 (\a b -> mplus (parse a) (parse b)) + (getProp s w) + (getProp sp w) + where + parse xs = case xs of + Just (l : r : t : b : _) -> Just (fi t, fi b, fi l, fi r) + _ -> Nothing -- | -- Helper to read a property |