swaybar: prioritize workspace scroll over bindsyms #8299
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds handling for scroll events (e.g. mouse wheel) to the hotspot callback equivalent to the fallback in
process_discrete_scroll
.While this may seem redundant (and in many cases, it is), it changes the priority when the user has Button4/Button5 bindsyms on the bar.
Before this commit:
After this commit:
If the user has no bindsyms for Button4/Button5, there is no change.
Utility
This shows an example of why this is useful. Here, the user has set up a Button4/Button5 bindsym to change the volume (see: top right corner) when scrolling over the bar.
Before this change, the user could no longer use the mouse wheel to switch workspaces:
After this change, the user can (only when scrolling over the workspaces):
Discussion
This is consistent with the idea that workspaces are hotspots, and hotspot event handlers take priority over the user's bindsyms, see 53f9dbd ("swaybar: Prioritize hotspot events to bar bindings").
However, note that this strays further away from i3's behaviour. On i3, user bindsyms take precedence over workspaces, even for Button1. In fact, it's explicitly documented as such.