aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/LayoutHints.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2008-02-18 11:57:26 +0100
committerAndrea Rossato <andrea.rossato@unibz.it>2008-02-18 11:57:26 +0100
commit8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0 (patch)
tree3df832d0e8a699f319280457884a12bdf7c9e844 /XMonad/Layout/LayoutHints.hs
parente891577f25c620a9726c2e7aa346391e36d8e82d (diff)
downloadXMonadContrib-8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0.tar.gz
XMonadContrib-8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0.tar.xz
XMonadContrib-8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0.zip
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
Diffstat (limited to 'XMonad/Layout/LayoutHints.hs')
-rw-r--r--XMonad/Layout/LayoutHints.hs19
1 files changed, 10 insertions, 9 deletions
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')