Skip to content

pager: Improve reliability of scrolling

When scrolling on the pager plasmoid to change virtual desktops, sometimes I use the two finger scroll of my touchpad (which has high resolution scrolling as a result), and sometimes I use a mouse with a standard scroll wheel (the kind that sends one scroll event per wheel click/tick). However, after using the touchpad to scroll at least once scrolling with the mouse wheel no longer works reliably (see the recording below).

pagerbug

I tracked the issue down to the fact that wheelDelta is no longer at 0 after scrolling with the touchpad, so for example if it was at -20 and I scroll once with the mouse 120 gets added to it, then the value is 100, which is neither >= 120 nor <= -120, so the scroll event gets ignored. So, this patch resets the value of wheelDelta to 0 after enough scroll wheel delta has accumulated to trigger switching desktops at least once.

For me after applying this patch scrolling with the touchpad still works, and scrolling with the mouse now works as expected.

This issue has been bugging me for a while, but I have only been able to find the cause now, and I couldn't find any reports in Bugzilla about it.

Merge request reports