From b4e7ab3d37b740bceccfc144640c1bc60199c41c Mon Sep 17 00:00:00 2001 From: Luc DUZAN Date: Fri, 10 Mar 2017 19:39:21 +0100 Subject: [PATCH] Add ModifySpacing message handling to SmartPacing and SmartSpacingWithEdge --- CHANGES.md | 2 ++ XMonad/Layout/Spacing.hs | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 1088807c..6f3fb976 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,8 @@ ### Breaking Changes + * Adding handling of modifySpacing message in smartSpacing and smartSpacingWithEdge layout modifier + * `XMonad.Actions.GridSelect` - Added field `gs_bordercolor` to `GSConfig` to specify border color. diff --git a/XMonad/Layout/Spacing.hs b/XMonad/Layout/Spacing.hs index f690cb10..f0b8f8d3 100644 --- a/XMonad/Layout/Spacing.hs +++ b/XMonad/Layout/Spacing.hs @@ -107,6 +107,10 @@ instance LayoutModifier SmartSpacing a where pureModifier _ _ _ [x] = ([x], Nothing) pureModifier (SmartSpacing p) _ _ wrs = (map (second $ shrinkRect p) wrs, Nothing) + pureMess (SmartSpacing px) m + | Just (ModifySpacing f) <- fromMessage m = Just $ SmartSpacing $ max 0 $ f px + | otherwise = Nothing + modifierDescription (SmartSpacing p) = "SmartSpacing " ++ show p -- | Surrounds all windows with blank space, and adds the same amount of spacing @@ -126,4 +130,8 @@ instance LayoutModifier SmartSpacingWithEdge a where | maybe False (\s -> null (up s) && null (down s)) (stack w) = runLayout w r | otherwise = runLayout w (shrinkRect p r) + pureMess (SmartSpacingWithEdge px) m + | Just (ModifySpacing f) <- fromMessage m = Just $ SmartSpacingWithEdge $ max 0 $ f px + | otherwise = Nothing + modifierDescription (SmartSpacingWithEdge p) = "SmartSpacingWithEdge " ++ show p