-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix brightness applet scroll #383
base: master
Are you sure you want to change the base?
Conversation
a12feaa
to
2cdcc03
Compare
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.
Builds and runs fine, had to transfer this to the laptop to test it
Works well, note that it can ONLY be tested on laptops because the effect of this is to adjust the brightness when scrolling over the applet WITHOUT showing the slider. On a desktop (no brightness control available), the slider works without doing anything but since the slider is not shown for scrolling over the applet this has no effect when brightness cannot be adjusted.
Only build warnings I got on rebuilding just the applet were the usual deprecation warnings, none of them were new.
The applet crashes when i try to scroll over the applet icon and i get this general protection fault from my kernel backtrace.
Hardware: never Thinkbook with amd graphics.
When i first scroll with the slider and second over the icon it works well and i got no crashes. |
Not sure, but maybe it is defined as a general step width. |
That general protection fault sounds pretty bad. Do you think it might be a hardware specific issue, or should I try to reproduce it with Quickemu (and Fedora I guess)? I've got these on my machine btw:
|
I don't think it is hardware specific, because scrolling over the applet works fine when i first use scrolling over the slider. |
I tried again and now i got a backtrace from the applet.
Full backtrace at https://www.dropbox.com/s/5ssln0oeqnt71mi/brightness-appet-crashes_backtrace?dl=0 |
This PR makes it possible to use the mouse wheel scroll to adjust brightness when hovering over the applet icon (without opening the popup).
There was code that was supposed to handle these scroll events already but it repeatedly bumped it by one percent, which only caused very high cpu usage, while most changes didn't even take effect.
This PR reuses
gpm_applet_slide_cb
andgpm_applet_slide_delayed_cb
to throttle all adjustments regardless of how they were triggered.One thing I don't fully understand is why we get a 10% change when scrolling over the slider in the popup. I don't see where that's specified, maybe that's the GTK default.
Also, the scroll event isn't triggered always/everywhere as the description in
gpm_applet_scroll_cb
suggests. If the popup is open then scroll doesn't work over the applet icon, or outside the slider area in the popup. That's a problem without this PR as well. I couldn't make it work but happy to try if anyone has suggestions.I've tested this only on Ubuntu Mate 22.04 / Thinkpad T480.