Summary: | Using KWin for wayland, GTK scroll events report wrong scroll distance. | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Emilio Cobos Álvarez (:emilio) <emilio> |
Component: | libinput | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED NOT A BUG | ||
Severity: | normal | CC: | emilio, nate |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
Sample python application that shows the issue.
Err, program that actually reproduces the issue |
Description
Emilio Cobos Álvarez (:emilio)
2021-06-09 13:55:53 UTC
(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. |