diff options
Diffstat (limited to '')
-rw-r--r-- | XMonad/Layout/LayoutHints.hs | 13 |
1 files changed, 7 insertions, 6 deletions
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') |