diff --git a/CHANGES.md b/CHANGES.md index aea30232..8fcbc6b2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -343,7 +343,16 @@ - Export `AvoidStruts` constructor - Restored compatibility with pre-0.13 configs by making the startup hook - unnecessary for correct functioning. + unnecessary for correct functioning (strut cache is initialized on-demand). + + - Fixed ignoring of strut updates from override-redirect windows, which is + default for xmobar. + + Previously, if one wanted xmobar to reposition itself after xrandr + changes and have xmonad handle that repositioning, one would need to + configure xmobar with `overrideRedirect = False`, which would disable + lowering on start and thus cause other problems. This is no longer + necessary. * `XMonad.Hooks.ManageHelpers` diff --git a/XMonad/Hooks/ManageDocks.hs b/XMonad/Hooks/ManageDocks.hs index 3f64cba6..69a1dac6 100644 --- a/XMonad/Hooks/ManageDocks.hs +++ b/XMonad/Hooks/ManageDocks.hs @@ -130,17 +130,22 @@ maybeInitStrutCache = maybe (queryDocks >>= foldlM (flip updateStrut) M.empty) p updateStrut :: Window -> WindowStruts -> X WindowStruts updateStrut w cache = do + when (w `M.notMember` cache) $ requestDockEvents w strut <- getStrut w pure $ M.insert w strut cache -- | Detects if the given window is of type DOCK and if so, reveals -- it, but does not manage it. manageDocks :: ManageHook -manageDocks = checkDock --> (doIgnore <+> setDocksMask) - where setDocksMask = do - ask >>= \win -> liftX $ withDisplay $ \dpy -> - io $ selectInput dpy win (propertyChangeMask .|. structureNotifyMask) - mempty +manageDocks = checkDock --> (doIgnore <+> doRequestDockEvents) + where + doRequestDockEvents = ask >>= liftX . requestDockEvents >> mempty + +-- | Request events for a dock window. +-- (Only if not already a client to avoid overriding 'clientMask') +requestDockEvents :: Window -> X () +requestDockEvents w = whenX (not <$> isClient w) $ withDisplay $ \dpy -> + io $ selectInput dpy w (propertyChangeMask .|. structureNotifyMask) -- | Checks if a window is a DOCK or DESKTOP window checkDock :: Query Bool