Created attachment 139141 [details] Sample python application that shows the issue. SUMMARY Using a mousewheel on Plasma 5 (under Wayland), gtk applications receive scroll events with odd deltas. On Gnome 40 or Plasma on X11, a single wheel tick reports a GdkScrollEvent.delta_y value of 1, while on plasma it reports 1.5. This causes GTK apps to scroll faster than usual. STEPS TO REPRODUCE 1. Run the application attached in Plasma with wayland 2. Use the mousewheel OBSERVED RESULT Note the scroll deltas: > scroll 0.0 1.5 EXPECTED RESULT > Scroll 0.0 1.0 SOFTWARE/OS VERSIONS Operating System: Fedora 34 KDE Frameworks Version: 5.82.0 Qt Version: 5.15.2 Kernel Version: 5.12.9-300.fc34.x86_64 OS Type: 64-bit Graphics Platform: Wayland ADDITIONAL INFORMATION I found this when trying to make Firefox scroll a bit faster: https://bugzilla.mozilla.org/show_bug.cgi?id=1715513 The patch there causes Gnome to work great, but on Plasma+Wayland the scroll speed is too high because of this bug.
(Let me know if I got the component wrong or what not btw)
I realized that the number you get is affected by the scroll factor in the mouse system settings (but I don't think I ever changed them, and in fact it seems there's no tick in the range slider to make this go to "1", so I suspect something else is going on...)
Created attachment 139569 [details] Err, program that actually reproduces the issue For some reason the file I attached was just a dummy GTK app, not the thing I was using for testing.
If someone can point me into the right direction I'm happy to try fixing this, fwiw :)
Ok, KWin does expose the discrete event as well, so we can listen to that.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4) > If someone can point me into the right direction I'm happy to try fixing > this, fwiw :) Does GDK divide delta values, e.g. by 10? KWin simply forwards delta values from libinput. On my machine, a single wheel click produces an axis event with a delta of 15. If GDK divides that value by 10, it could explain 1.5.
(In reply to Vlad Zahorodnii from comment #6) > (In reply to Emilio Cobos Álvarez (:emilio) from comment #4) > Does GDK divide delta values, e.g. by 10? KWin simply forwards delta values > from libinput. On my machine, a single wheel click produces an axis event > with a delta of 15. If GDK divides that value by 10, it could explain 1.5. That's exactly right: https://gitlab.gnome.org/GNOME/gtk/-/blob/6bd96522e87682d48d9f1218050cff9f7b0bb3ae/gdk/wayland/gdkdevice-wayland.c#L1753-1764
And mutter sends always 10 for discrete events: https://gitlab.gnome.org/GNOME/mutter/-/blob/bb6ae40a0feb93727dff8c51bf0560279d8d89db/src/wayland/meta-wayland-pointer.c#L73
As far as I know, "10" is not enforced by the core spec, i.e. kwin is not in the wrong. Using discrete delta might be a better option indeed, note that it will be obsolete with wl_pointer.axis_v120.
(In reply to Vlad Zahorodnii from comment #9) > As far as I know, "10" is not enforced by the core spec, i.e. kwin is not in > the wrong. Using discrete delta might be a better option indeed, note that > it will be obsolete with wl_pointer.axis_v120. Oh, do you have a link for that? I have a patch to use the discrete deltas here: https://phabricator.services.mozilla.com/D135453. I guess we could check the GTK source being `MOUSE`, and force the delta to 1, or we can just WONTFIX https://bugzilla.mozilla.org/show_bug.cgi?id=1749169 and claim we're not doing anything wrong because the KWin delta is just higher than the Mutter delta, but both of those feel a bit unfortunate.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #10) > Oh, do you have a link for that? I have a patch to use the discrete deltas > here: https://phabricator.services.mozilla.com/D135453. https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72 It's equivalent to axis_discrete in some way. 1 axis_discrete == 120 axis_v120
(In reply to Vlad Zahorodnii from comment #11) > (In reply to Emilio Cobos Álvarez (:emilio) from comment #10) > https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72 > > It's equivalent to axis_discrete in some way. 1 axis_discrete == 120 > axis_v120 Ah, ok, I see. As long as we can get the discrete events somehow from GTK should be fine, thanks.