-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X.H.ManageDocks: React to strut updates of override_redirect docks #492
X.H.ManageDocks: React to strut updates of override_redirect docks #492
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that (and a similar feeling about the deleteFromStru[c]tCache
correction), this seems okay.
@@ -121,8 +123,11 @@ remove :: (ExtensionClass a, XLike m) => a -> m () | |||
remove wit = modifyStateExts $ M.delete (show . typeOf $ wit) | |||
|
|||
modified :: (ExtensionClass a, Eq a, XLike m) => (a -> a) -> m Bool | |||
modified f = do | |||
modified = modifiedM . (pure .) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably this refactor should be a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can definitely turn this into a commit on its own but a separate PR seems excessive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that (and a similar feeling about the
deleteFromStru[c]tCache
correction), this seems okay.
I split both into separate commits.
Fixes: c48d81e ("Fix caching issues in ManageDocks")
This is primarily a cleanup to make it easier to use `setDocksMask` from the on-demand cache init (see further commits), but it makes the code nicer: - the logic to refresh and cache a strut is now concentrated in `updateStrut` instead of being spread over `updateStrutCache` and `docksEventHook` - the logic to initialize the cache if not yet initialized is now concentrated in `maybeInitStrutCache` instead of being spread over `initStrutCache` and `getStrutCache`, so the dual-purpose return type of `getStrutCache` is no more - the logic to detect changes and refresh is now always handled by `XS.modifiedM` instead of an additional `||` Related: xmonad#406
We only requested PropertyChange events from docks in the `manageDocks` manageHook, but that only gets called for normal windows, not override_redirect ones. Therefore, xmobar in its default configuration wouldn't get its struts refreshed on changes. This resulted in gaps not updating after xmobar repositions itself on xrandr changes. If one wanted to handle that repositioning in xmonad, it was possible to configure xmobar with `overrideRedirect = False`, which is meant for window managers with proper EWMH stacking order support [1], so in xmonad it resulted in xmobar covering fullscreen windows. That can be worked around by adding `checkDock --> doLower` to manageHook, but it starts to smell of too many workarounds. [1]: https://specifications.freedesktop.org/wm-spec/wm-spec-1.5.html#STACKINGORDER The fix is to request PropertyChange events for all windows that we treat as docks. Related: xmonad#490
81f4bd2
to
ec14617
Compare
Description
We only requested PropertyChange events from docks in the
manageDocks
manageHook, but that only gets called for normal windows, not override_redirect ones. Therefore, xmobar in its default configuration wouldn't get its struts refreshed on changes. This resulted in gaps not updating after xmobar repositions itself on xrandr changes.If one wanted to handle that repositioning in xmonad, it was possible to configure xmobar with
overrideRedirect = False
, which is meant for window managers with proper EWMH stacking order support, so in xmonad it resulted in xmobar covering fullscreen windows. That can be worked around by addingcheckDock --> doLower
to manageHook, but it starts to smell of too many workarounds.The fix is to request PropertyChange events for all windows that we treat as docks.
Related: #406
Related: #490
Checklist
I've read CONTRIBUTING.md
I tested my changes with xmonad-testing
I updated the
CHANGES.md
filen/a I updated the
XMonad.Doc.Extending
file (if appropriate)