From 8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Mon, 18 Feb 2008 11:57:26 +0100 Subject: Refactor MouseResize, remove isDecoration and introduce isInStack, isVisible, isInvisible This patch includes several changes, which are strictly related and cannot be recorded separately: - remove Decoraion.isDecoartion and introduce Decoration.isInStack (with the related change to LayoutHints) - in Decoration introduce useful utilities: isVisible, isInvisible, isWithin and lookFor' - MouseResize: - invisible inputOnly windows will not be created; - fix a bug in the read instance which caused a failure in the state deserialization. darcs-hash:20080218105726-32816-9d42d4fdff75fad3258aec92d059e5155f0e64bc.gz --- XMonad/Layout/LayoutHints.hs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'XMonad/Layout/LayoutHints.hs') diff --git a/XMonad/Layout/LayoutHints.hs b/XMonad/Layout/LayoutHints.hs index f8df071..6442934 100644 --- a/XMonad/Layout/LayoutHints.hs +++ b/XMonad/Layout/LayoutHints.hs @@ -13,15 +13,17 @@ -- Make layouts respect size hints. ----------------------------------------------------------------------------- -module XMonad.Layout.LayoutHints ( - -- * usage - -- $usage - layoutHints, - LayoutHints) where +module XMonad.Layout.LayoutHints + ( -- * usage + -- $usage + layoutHints + , LayoutHints + ) where import XMonad hiding ( trace ) import XMonad.Layout.LayoutModifier -import XMonad.Layout.Decoration ( isDecoration ) +import XMonad.Layout.Decoration ( isInStack ) + -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: -- @@ -49,14 +51,13 @@ data LayoutHints a = LayoutHints deriving (Read, Show) instance LayoutModifier LayoutHints Window where modifierDescription _ = "Hinted" - redoLayout _ _ _ xs = do + redoLayout _ _ s xs = do bW <- asks (borderWidth . config) xs' <- mapM (applyHint bW) xs return (xs', Nothing) where applyHint bW (w,r@(Rectangle a b c d)) = withDisplay $ \disp -> do - isd <- isDecoration w sh <- io $ getWMNormalHints disp w let (c',d') = adjBorders 1 bW . applySizeHints sh . adjBorders bW (-1) $ (c,d) - return (w, if isd then r else Rectangle a b c' d') + return (w, if isInStack s w then r else Rectangle a b c' d') -- cgit v1.2.3