-
-
Notifications
You must be signed in to change notification settings - Fork 279
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.EwmhDesktops: Add customization for handling the _NET_CURRENT_DESKTOP requests #923
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.
Otherwise, looks good.
I've tested the example usage of the new focusWorkspace manually, as far as I can tell it works as expected. |
Sorry, I'd already re-reviewed but didn't push the "approve" button; wanted to wait on CI. |
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.
It is beatiful. :-)
Commented about a couple of nits anyway, as I usually do.
Plus worth noting that a complete integration with IndependentScreens would also involve using focusWindow'
for activateHook
(converted into a ManageHook), but it would still potentially misbehave because _NET_ACTIVE_WINDOW requests from pagers (and tools like wmctrl) aren't overridable right now. :-(
I tested it again manually after the rename. It works as expected. |
Could you clarify what you meant by this paragraph? With the non |
Oh okay I didn't realise wmctrl switches the desktop first - that's awesome. There may be something else that doesn't, but maybe we don't need to care - not having to complicate the code any more is good. |
We are permitted to convert it to an urgency indicator if it's not on the active workspace. |
The things that I intended to convey were the following:
Therefore I consider the contents of this PR complete, unless modifications are requested. |
Also I haven't noticed until now but this probably closes this #776 issue. |
That does look likely. |
005ab9e
to
fa76527
Compare
Added a configuration option to change the action for handling the _NET_CURRENT_DESKTOP requests.
fa76527
to
619a347
Compare
Thanks! |
Yeah, I agree that the PR was good and no modifications were requested from me. Sorry for not being clear earlier, must've been in a hurry, and then went AFK. The only little issue that may still be unclear is that there's that special case for Hope this makes it clearer :-) |
Sorry, I know that this has been merged. But I
I know that this has been merged, but this seems to be the appropriate space to ask. What do you mean by ill suited? In my config I use If that is a hook that solves the issues that you are thinking about, I could add it to X.L.IndependentScreens in a PR tomorrow. |
I'm specifically referring to this bit: xmonad-contrib/XMonad/Hooks/EwmhDesktops.hs Lines 509 to 512 in 4fc3642
Since I didn't consider the use-case of integrating IndependentScreens when implementing this, the W.focusWindow there isn't overridable.
It doesn't solve the issue I'm thinking about, but then we don't know if that issue isn't purely hypothetical. 🙂 It definitely does solve the actual issue you encountered, so either documenting it (it's simple enough really) or adding it as a function to IndependentScreens seems valuable. tl;dr - only read this bit if you enjoy discussing complex hypothetical technical shit To expand a bit more on my thinking back when the hooks were implemented — I was aware of the theoretical possibility of someone needing to override all the ways
|
I understand now. Thank you for the explanation. I found the second part especially fascinating because I typically design poor APIs, and this gave me examples of what to consider. |
Description
This adds a
setEwmhSwitchDesktopAction
function to customize how switching to the desired workspace is done when handling a _NET_CURRENT_DESKTOP request. The motivation for this was that commands using the EWMH fuctionality such aswmctrl -s
pulled workspaces to the wrong screen in certain cases when using theX.L.IndependentScreens
module, instead of making them active on the screen that they belong on, but the behavior seemed to be a sensible default since use of that module is not mandatory.With the new function I changed the action to the following:
action workspaceId = viewOnScreen (unmarshallS workspaceId) workspaceId
This no longer pulls the workspace to the wrong screen when it is hidden, and it is on a screen that does not contain the current workspace, this is also used as the example in the documentation.
Checklist
I've read CONTRIBUTING.md
I've considered how to best test these changes (property, unit,manually, ...) and concluded:
that manual testing is adequate since change just added a customization option without changing the default.
I did not find a difference in the default behavior, using this version and the example is currently working as expected
on my system.
I updated the
CHANGES.md
file