mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
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.
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user