diff options
-rw-r--r-- | XMonad/Layout/LayoutHints.hs | 13 | ||||
-rw-r--r-- | XMonadContrib.cabal | 2 |
2 files changed, 8 insertions, 7 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') diff --git a/XMonadContrib.cabal b/XMonadContrib.cabal index fba46e8..68b6350 100644 --- a/XMonadContrib.cabal +++ b/XMonadContrib.cabal @@ -65,7 +65,7 @@ library XMonad.Layout.Grid -- XMonad.Layout.HintedTile XMonad.Layout.LayoutCombinators - -- XMonad.Layout.LayoutHints + XMonad.Layout.LayoutHints XMonad.Layout.LayoutModifier XMonad.Layout.LayoutScreens XMonad.Layout.MagicFocus |