-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fixed natural scrolling bug #9
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.
Just a comment; also did you build and test this locally? Did you try without natural turned on as well?
[email protected]/extension.js
Outdated
case Clutter.ScrollDirection.UP: | ||
volume += this._get_step(); | ||
volume += naturalScroll ? -this._get_step() : this._get_step(); |
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 think maybe pull this ternary out to store a ? -1 : 1
multiplier before the switch?
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.
Done.
Yes, it works with natural scrolling on and off. |
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.
One more thing
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.
Oh and...
Oh - I guess this assumes all scroll events come from the trackpad? What if a user uses a mouse instead but has natural enabled? It might flip how the mouse behaves I think. |
Oh my god... I don't know how I didn't realise that. I am discarding this and I will create another PR with an "Invert Direction" settings added. I am so sorry. |
I think it might be possible to check the source of the scroll event though. You could experiment with that. |
Used the Gio.Settings API to query the natural-scroll option and inverted scrolling accordingly.