From c5d58911c45adf44eaa0c76354214c4696bbc88b Mon Sep 17 00:00:00 2001 From: "l.mai" Date: Tue, 6 Nov 2007 00:30:20 +0100 Subject: make LayoutHints compile again darcs-hash:20071105233020-42ea9-524293c9ebb76b29c181ed45235bd455ff275ce4.gz --- XMonad/Layout/LayoutHints.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'XMonad/Layout/LayoutHints.hs') diff --git a/XMonad/Layout/LayoutHints.hs b/XMonad/Layout/LayoutHints.hs index 1268b3f..0bc9a3f 100644 --- a/XMonad/Layout/LayoutHints.hs +++ b/XMonad/Layout/LayoutHints.hs @@ -22,9 +22,9 @@ module XMonad.Layout.LayoutHints ( import XMonad.Operations ( applySizeHints, D ) import Graphics.X11.Xlib import Graphics.X11.Xlib.Extras ( getWMNormalHints ) -import {-#SOURCE#-} Config (borderWidth) import XMonad hiding ( trace ) import XMonad.Layout.LayoutModifier +import Control.Monad.Reader ( asks ) -- $usage -- > import XMonad.Layout.LayoutHints @@ -39,19 +39,20 @@ layoutHints = ModifiedLayout LayoutHints -- | Expand a size by the given multiple of the border width. The -- multiple is most commonly 1 or -1. -adjBorders :: Dimension -> D -> D -adjBorders mult (w,h) = (w+2*mult*borderWidth, h+2*mult*borderWidth) +adjBorders :: Dimension -> Dimension -> D -> D +adjBorders bW mult (w,h) = (w+2*mult*bW, h+2*mult*bW) data LayoutHints a = LayoutHints deriving (Read, Show) instance LayoutModifier LayoutHints Window where modifierDescription _ = "Hinted" redoLayout _ _ _ xs = do - xs' <- mapM applyHint xs + bW <- asks (borderWidth . config) + xs' <- mapM (applyHint bW) xs return (xs', Nothing) where - applyHint (w,Rectangle a b c d) = + applyHint bW (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) + let (c',d') = adjBorders 1 bW . applySizeHints sh . adjBorders bW (-1) $ (c,d) return (w, Rectangle a b c' d') -- cgit v1.2.3