High-resolution scroll wheel support
This commit adds high-resolution wheel scrolling to wl_pointer
. The new event is wl_pointer.axis_v120
and carries a value representing wheel detents as fractions or multiples of 120, i.e. two wheel detents are 240, half a wheel movement is 60. This is taken straight from the Windows API which has been using this approach since Vista.
The kernel supports this as of v5.0 (see my blog post) but it's obviously HW dependent. Logitech mice are supported, otherwise any mouse that shows a ResolutionMultiplier
in the hid-recorder output (most Microsoft-branded mice of the last decade).
In the kernel, high-resolution and low-resolution mouse wheel events are separate event streams and (Logitech) mice don't guarantee that old events and new events match up, i.e. you may get different numbers of hires events per wheel detent depending on scrolling speed/direction/etc. libinput implements a new set of event types LIBINPUT_EVENT_POINTER_AXIS_FINGER
, LIBINPUT_EVENT_POINTER_AXIS_WHEEL
, and LIBINPUT_EVENT_POINTER_AXIS_CONTINUOUS
and deprecates the existing LIBINPUT_EVENT_POINTER_AXIS
events.
In the wayland protocol, thanks to clients having to opt in for any specific version we can deprecate wl_pointer.axis_discrete
(no longer sent to clients supporting wl_pointer
v8 and above) and instead send out wl_pointer.axis_v120
. This makes life reasonably simple in both the client and the compositor, backwards compat code can just take wl_pointer.axis_discrete
, multiply it by 120 and life is the shape of your favourite stonefruit.
Other pieces of the stack required for this to work:
-
libinput merge request: libinput/libinput!652 (merged) (was libinput/libinput!139 (closed)) -
wayland merge request: !72 (merged) (this MR here) -
weston merge request: weston!409 (closed) -
gtk merge request: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/1624 -
mutter merge request: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1177 -
XWayland merge request: xorg/xserver!118 (merged) -
xf86-input-libinput merge request: xorg/driver/xf86-input-libinput!24 (merged)
Branch names in all cases is hi-res-scrolling
.
There's also a Fedora 32 COPR with the packages (manually built so it may lag behind at times)
Still filed as WIP so we can get all pieces lined up.
cc @carlosg, @romangg, @carewolf, @ddevault, @emersion
edit 2020-05-19:
- new version pushed, removing the old mix of v120 plus discrete, replacing it with a straightforward
discrete
for versions < 8 andv120
for versions >= 8