Closed andirsun closed 3 years ago
This works most of the time although I did get into a state where the icon (and popover) stopped responding to scrolling - haven't been able to reproduce that issue yet. Also had an issue where scrolling on the indicator in the greeter caused wingpanel to crash and the login to fail.
I can confirm that the crash when horizontal scrolling in the greeter is reproducible. I haven't been able to reproduce the login failure thereafter though. The crash does not occur in master.
Found another issue: Very fast random scrolling on the icon (all directions at random) can result in the notification popover no longer showing on any scrolling although the brightness still changes.
The "handle_scroll_event" code is duplicated from ScreenBrightness.vala - would it be possible to put it in a src/Utils.vala
and shared? I think this can be left for another PR though as there is some existing duplication in master.
Thats weird I've now discovered that the crash in greeter does occur in master - but with vertical scrolling not horizontal :shrug:. I'll raise an issue.
I've now pushed a PR to fix the crash in greeter.
The "handle_scroll_event" code is duplicated from ScreenBrightness.vala - would it be possible to put it in a
src/Utils.vala
and shared? I think this can be left for another PR though as there is some existing duplication in master.
Done!
@andirsun Great work thank!. I wonder whether infact the Util handler could also do the brightness change? It should have access to the DeviceManager service. There could then be a single correct algorithm to do this and #207 would no longer be required. Sorry for the mission drift - this could be done in a separate PR if desired.
@jeremypw Done!
I'd like to get #210 merged first as it addresses a crash then check this PR still works as expected. If you could test it out on your computer to confirm it works for you I would be grateful. It already has a code approval.
Sure! Let me test it and report.
@andirsun I have fixed the conflicts with master for you and also noticed a flaw in the logic for showing the notification. As it was, the notification did not show until the popover had been created and shown. Now it shows if the popover has never been shown OR it is not currently showing.
@kvdz Are you OK with this PR now?
fixes: #201