From b9fb7f750e00e35363832fdd398366621eabb2d3 Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Sat, 5 Apr 2008 00:05:58 +0200 Subject: update contrib for applySizeHints changes darcs-hash:20080404220558-462cf-2d7837b574aec854a158213d45a34cca75e38438.gz --- XMonad/Layout/LayoutHints.hs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'XMonad/Layout/LayoutHints.hs') diff --git a/XMonad/Layout/LayoutHints.hs b/XMonad/Layout/LayoutHints.hs index f8aa47b..ca139ed 100644 --- a/XMonad/Layout/LayoutHints.hs +++ b/XMonad/Layout/LayoutHints.hs @@ -42,22 +42,15 @@ import XMonad.Layout.Decoration ( isInStack ) layoutHints :: (LayoutClass l a) => l a -> ModifiedLayout LayoutHints l a layoutHints = ModifiedLayout LayoutHints --- | Expand a size by the given multiple of the border width. The --- multiple is most commonly 1 or -1. -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 _ _ s xs = do - bW <- asks (borderWidth . config) - xs' <- mapM (applyHint bW) xs + xs' <- mapM applyHint xs return (xs', Nothing) where - applyHint bW (w,r@(Rectangle a b c d)) = - withDisplay $ \disp -> do - sh <- io $ getWMNormalHints disp w - let (c',d') = adjBorders 1 bW . applySizeHints sh . adjBorders bW (-1) $ (c,d) - return (w, if isInStack s w then Rectangle a b c' d' else r) + applyHint (w,r@(Rectangle a b c d)) = do + adj <- mkAdjust w + let (c',d') = adj (c,d) + return (w, if isInStack s w then Rectangle a b c' d' else r) -- cgit v1.2.3