-
Notifications
You must be signed in to change notification settings - Fork 11
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
if natural-scroll is enabled, invert scroll inputs #113
base: main
Are you sure you want to change the base?
Conversation
When natural scrolling setting is enabled, the scroll inputs are essentially the opposite of what's actually physically happening. This is fine for scrolling down a page, but feels very weird for things like volume control. Invert natural scrolling inputs so scrolling up actually increases the volume, and vice versa. Fixes Moon-0xff#112.
extension.js
Outdated
if (event.is_pointer_emulated()) | ||
return Clutter.EVENT_PROPAGATE; | ||
|
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'm not sure why this was initially added. It seems like my touchpad has a lot of scroll events that are considered emulated but otherwise look normal. This was causing problems for me because I have another extension with scroll event handling on the entire menu bar. A bunch of scroll events would hit this and propagate through, even though I just wanted to interact with the mpris label.
So that's why I removed it. Could also just make it return EVENT_STOP instead.
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'm not sure why this was initially added.
I don't remember, though gnome-shell's code does the same.
This was causing problems for me because I have another extension with scroll event handling on the entire menu bar.
We found the same issue you are describing with Dash-to-panel (#47).
So that's why I removed it. Could also just make it return EVENT_STOP instead.
I'm not sure if we want "emulated scroll events" to trigger the scrolling action, this would probably change the volume increasing/decreasing speed in some hardware (can you test if this is the case in yours?). The idea is to follow gnome's volume widget on behaviour, though we are changing scroll direction here... speed, so I'm more inclined to change EVENT_PROPAGATE to EVENT_STOP.
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 found this bugzilla thread: https://bugzilla.gnome.org/show_bug.cgi?id=687573, and these commits: https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/7d4e14f38455977ffb103acd85239ed6b1a9d816, https://gitlab.gnome.org/GNOME/gnome-shell/-/commit/c9741ae3d5f661b2aee352c50ce21fab16694fbe (the last one is somewhat confusing to me since I definitely observe events with is_pointer_emulated()
true).
It seems that some events are essentially duplicated, one emulated and one not emulated... I don't have the historical reasoning for why this is the case but my impression is that it has to do with retrofitting touchpad support into X11.
I suppose ideally other extensions should also be checking this, but in practice it doesn't make a lot of sense to propagate the events instead of just ignoring them completely.
Upshot: happy to use EVENT_STOP, makes sense.
While this might be out of scope, it makes sense that if we decide to fix the direction of the volume slider, we should do the same for the built-in global slider. This can indeed be done, though I'm not sure how. |
IMO, it is out of scope of the extension, but definitely this PR. Options:
I'm inclined to do 4 because I'm lazy. Not really a fan of 1 for the reasons mentioned. 2 and 3 outside the scope of the project. |
I do believe it would be of value to also flip the volume slider, and just the volume slider, So option 4 it is! |
Now, this change seems controversial, and also some people would prefer it the other way around as in (#89). So I think this work should be adapted to fit all kinds of bar. I mean, being able to choose between:
As reference, this commit, |
Although I see that some people would want the behavior to be consistent with the GNOME behavior, it doesn't seem likely that anyone would want this "always". That is, even if it is inconsistently with GNOME behavior. I think it should be sufficient to just wrap the code I added in an if statement and add a setting called "respect natural scrolling" or something. |
Thing is, I also felt the direction reversed when testing it for the first time using the "Traditional" setting, so making this change accessible to "Traditional" users makes sense to me. Also, sorry for not having a follow-up on this yet. |
When natural scrolling setting is enabled, the scroll inputs are essentially the opposite of what's actually physically happening. This is fine for scrolling down a page, but feels very weird for things like volume control.
Invert natural scrolling inputs so scrolling up actually increases the volume, and vice versa.
Fixes #112.