aboutsummaryrefslogtreecommitdiffstats
path: root/ManageDocks.hs
diff options
context:
space:
mode:
authorAlex Tarkovsky <alextarkovsky@gmail.com>2007-10-10 23:38:53 +0200
committerAlex Tarkovsky <alextarkovsky@gmail.com>2007-10-10 23:38:53 +0200
commit2f71ea564022ea66b4c1863b4a980e76c5cae0d2 (patch)
tree282715c52b3d947852695d555dd613de0bc496d8 /ManageDocks.hs
parente10319fb0e72937246ff27d8f93d9d5c756ce7f1 (diff)
downloadXMonadContrib-2f71ea564022ea66b4c1863b4a980e76c5cae0d2.tar.gz
XMonadContrib-2f71ea564022ea66b4c1863b4a980e76c5cae0d2.tar.xz
XMonadContrib-2f71ea564022ea66b4c1863b4a980e76c5cae0d2.zip
Fix EwmhDesktops, ManageDocks, and SetWMName compilation for amd64
darcs-hash:20071010213853-bd4fb-66e3492b55dc7aeb9dee18201a66f540b52e8b53.gz
Diffstat (limited to 'ManageDocks.hs')
-rw-r--r--ManageDocks.hs60
1 files changed, 30 insertions, 30 deletions
diff --git a/ManageDocks.hs b/ManageDocks.hs
index 3ff0248..16015bd 100644
--- a/ManageDocks.hs
+++ b/ManageDocks.hs
@@ -19,10 +19,10 @@
-- * To reset the gap, press Mod-b twice and restart xmonad (Mod-q)
-----------------------------------------------------------------------------
module XMonadContrib.ManageDocks (
- -- * Usage
- -- $usage
- manageDocksHook
- ) where
+ -- * Usage
+ -- $usage
+ manageDocksHook
+ ) where
import Control.Monad.Reader
import XMonad
@@ -51,40 +51,40 @@ import Data.Word
-- not manage it. If the window has the STRUT property set, adjust the gap accordingly.
manageDocksHook :: Window -> X (WindowSet -> WindowSet)
manageDocksHook w = do
- hasStrut <- getStrut w
- maybe (return ()) setGap hasStrut
+ hasStrut <- getStrut w
+ maybe (return ()) setGap hasStrut
- isDock <- checkDock w
- if isDock then do
- reveal w
- return (W.delete w)
- else do
- return id
+ isDock <- checkDock w
+ if isDock then do
+ reveal w
+ return (W.delete w)
+ else do
+ return id
-- |
-- Checks if a window is a DOCK window
checkDock :: Window -> X (Bool)
checkDock w = do
- a <- getAtom "_NET_WM_WINDOW_TYPE"
- d <- getAtom "_NET_WM_WINDOW_TYPE_DOCK"
- mbr <- getProp a w
- case mbr of
- Just [r] -> return (r == d)
- _ -> return False
+ a <- getAtom "_NET_WM_WINDOW_TYPE"
+ d <- getAtom "_NET_WM_WINDOW_TYPE_DOCK"
+ mbr <- getProp a w
+ case mbr of
+ Just [r] -> return (fromIntegral r == d)
+ _ -> return False
--- |
+-- |
-- 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
+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
-- |
-- Helper to read a property
@@ -98,5 +98,5 @@ setGap gap = modifyGap (\_ -> max4 gap)
-- |
-- Piecewise maximum of a 4-tuple of Ints
-max4 :: (Int, Int, Int, Int) -> (Int, Int, Int, Int) -> (Int, Int, Int, Int)
+max4 :: (Int, Int, Int, Int) -> (Int, Int, Int, Int) -> (Int, Int, Int, Int)
max4 (a1,a2,a3,a4) (b1,b2,b3,b4) = (max a1 b1, max a2 b2, max a3 b3, max a4 b4)