aboutsummaryrefslogtreecommitdiffstats
path: root/LayoutHints.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-06-23 23:09:52 +0200
committerDavid Roundy <droundy@darcs.net>2007-06-23 23:09:52 +0200
commit5f1312128d87961231d5431af0885711a01cd120 (patch)
tree5b785ff7779d1d842bc17ac554ccbe759ea4c35d /LayoutHints.hs
parentb40d0f8237f4140decbf4edc7366b900cf82428b (diff)
downloadXMonadContrib-5f1312128d87961231d5431af0885711a01cd120.tar.gz
XMonadContrib-5f1312128d87961231d5431af0885711a01cd120.tar.xz
XMonadContrib-5f1312128d87961231d5431af0885711a01cd120.zip
make everything work with new doLayout.
This modifies all the contrib modules to work (so far as I know) with the new contrib layout. The exception is the LayoutHooks module, which isn't used. It exports an API that is inherently unsafe, so far as I can tell (and always has been). darcs-hash:20070623210952-72aca-1993ca13dc6996b59fedacc271c03fbaf87eabaa.gz
Diffstat (limited to '')
-rw-r--r--LayoutHints.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/LayoutHints.hs b/LayoutHints.hs
index 274c037..5daece8 100644
--- a/LayoutHints.hs
+++ b/LayoutHints.hs
@@ -21,6 +21,7 @@ import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras ( getWMNormalHints )
import {-#SOURCE#-} Config (borderWidth)
import XMonad hiding ( trace )
+import XMonadContrib.LayoutHelpers ( layoutModify, idModMod )
-- $usage
-- > import XMonadContrib.LayoutHints
@@ -32,12 +33,10 @@ adjBorders :: Dimension -> D -> D
adjBorders mult (w,h) = (w+2*mult*borderWidth, h+2*mult*borderWidth)
layoutHints :: Layout Window -> Layout Window
-layoutHints l = l { doLayout = \r x -> doLayout l r x >>= applyHints
- , modifyLayout = \x -> fmap layoutHints `fmap` modifyLayout l x }
-
-applyHints :: [(Window, Rectangle)] -> X [(Window, Rectangle)]
-applyHints xs = mapM applyHint xs
- where applyHint (w,Rectangle a b c d) =
+layoutHints = layoutModify applyHints idModMod
+ where applyHints _ _ xs = do xs' <- mapM applyHint xs
+ return (xs', Nothing)
+ applyHint (w,Rectangle a b c d) =
withDisplay $ \disp ->
do sh <- io $ getWMNormalHints disp w
let (c',d') = adjBorders 1 . applySizeHints sh . adjBorders (-1) $ (c,d)