Bug 487831

Summary: Mouse scrolling ignores every n-th step of scroll wheel on lower scroll speed settings
Product: [Plasma] kwin Reporter: Patrik <idvert3x>
Component: inputAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: nate, xaver.hugl
Priority: NOR    
Version First Reported In: 5.27.11   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Patrik 2024-05-31 09:57:47 UTC
After switching from X.org to Wayland, I encounter issues with mouse scrolling behavior.
When the Scrolling speed is set to something lower than the maximum, every N-th mouse scroll wheel step is ignored.
For example, when Scrolling speed is set to the 3rd mark in System Settings - Mouse dialog, every 2nd scroll wheel step is ignored, in both directions.

STEPS TO REPRODUCE
1. Start Wayland plasma session
2. Connect (USB) mouse with a scroll wheel
3. Set Scrolling speed to 3 in System Settings - Mouse.
4. Observe the described behavior

OBSERVED RESULT
Every n-th step on scroll wheel is ignored on lower scroll speed settings.

EXPECTED RESULT
The scroll should only move less lines instead of ignoring every n-th scroll step.

SOFTWARE/OS VERSIONS
Linux: Ubuntu 24.04
Kernel: 6.9.3-060903-generic
KDE Plasma Version:  5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13

ADDITIONAL INFORMATION
Mouse is MIONIX NAOS 8200
Comment 1 Patrik 2024-06-07 20:31:31 UTC
Using libinput debug-events, I'm able to see that mouse wheel steps are being received:

-event13  POINTER_SCROLL_WHEEL    +3.259s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +3.934s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +4.622s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +5.279s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +6.006s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +6.663s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +7.303s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +7.953s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +8.541s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)
 event13  POINTER_SCROLL_WHEEL    +9.175s       vert -15.00/-120.0* horiz 0.00/0.0 (wheel)

But when using wev, only every 2nd one causes an actual scroll to occur:
[13:      wl_pointer] axis_source: 0 (wheel)
[13:      wl_pointer] axis_stop: axis: 0 (vertical), discrete: -1
[13:      wl_pointer] axis: time: 901017; axis: 0 (vertical), value: -7.000000
[13:      wl_pointer] frame
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 0 (wheel)
[13:      wl_pointer] axis_stop: axis: 0 (vertical), discrete: -1
[13:      wl_pointer] axis: time: 902380; axis: 0 (vertical), value: -15.000000
[13:      wl_pointer] frame
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 0 (wheel)
[13:      wl_pointer] axis_stop: axis: 0 (vertical), discrete: -1
[13:      wl_pointer] axis: time: 903764; axis: 0 (vertical), value: -15.000000
[13:      wl_pointer] frame
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 0 (wheel)
[13:      wl_pointer] axis_stop: axis: 0 (vertical), discrete: -1
[13:      wl_pointer] axis: time: 905061; axis: 0 (vertical), value: -15.000000
[13:      wl_pointer] frame
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 0 (wheel)
[13:      wl_pointer] axis_stop: axis: 0 (vertical), discrete: -1
[13:      wl_pointer] axis: time: 906299; axis: 0 (vertical), value: -15.000000
[13:      wl_pointer] frame
[13:      wl_pointer] frame
Comment 2 Nate Graham 2024-06-11 19:59:44 UTC

*** This bug has been marked as a duplicate of bug 484309 ***
Comment 3 Patrik 2024-06-11 20:48:13 UTC
@Nate Graham: I noticed you marked the issue as duplicate, but the referenced issue seems to describe a different problem in a different context.
In my case, all programs running under KDE Wayland are affected (all Qt and GTK apps, not just Kirigami apps), and scroll steps are being ignored, instead of some issue with animations mentioned in issue 484309.

Was this issue marked as duplicate due to the root cause (underlying technical problem) being the same, or could it be a mistake?
Comment 4 Nate Graham 2024-06-11 20:54:34 UTC
Hmm, if GTK apps are affected too, indeed it would be a different issue. In fact I wonder if that bug is actually caused by this one...
Comment 5 Patrik 2024-06-11 21:18:59 UTC
From the logs I managed to collect (included in a comment above), it seems that Wayland server isn't correctly passing scroll events (visible in libinput's debug output) to wayland clients (wev debug tool in this case).

I did some searching, and I found at least one other person experiencing this problem:
https://discussion.fedoraproject.org/t/scroll-issue-skipping-steps/112622
Comment 6 Zamundaaa 2024-06-11 23:41:51 UTC
This is intentional-ish, caused by https://invent.kde.org/plasma/kwin/-/merge_requests/3900.

*** This bug has been marked as a duplicate of bug 470746 ***