High-resolution scroll wheel support
Starting with Linux Kernel v5.0 two new axes are available for high-resolution wheel scrolling:
Both axes send data in fractions of 120 where each multiple of 120 amounts to one logical scroll event. Fractions of 120 indicate a wheel movement less than one detent. A "detent" is the named used in the Kernel for a mouse wheel click:
Three new events are now available on libinput:
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS. These events replace the
LIBINPUT_EVENT_POINTER_AXIS event, so new clients should simply ignore that event.
LIBINPUT_EVENT_POINTER_SCROLL_WHEEL event adds a new API
libinput_pointer_scroll_get_value_v120() is a mirror from the kernel API (itself a copy of the Windows API). The new event is sent for all wheel events, even those that don't technically support high-resolution scrolling and even on older kernels that don't have this feature. So callers can simply ignore any
LIBINPUT_EVENT_POINTER_AXIS event and use the new event types only.
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS, as well as
LIBINPUT_EVENT_POINTER_SCROLL_WHEEL, a new API is available:
libinput_pointer_scroll_get_value(). This API is similar to
- libinput: Merged
- Wayland: It was open about a year ago by Peter Hutterer, it'd be nice to get some feedback.
- Mutter: This PR
- GTK: gtk!3839
- xf86-input-libinput: Merged
How to test it:
Clone and install my libinput branch: https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/652
Clone and install Peter's Wayland protocol: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72/
Run Mutter and GTK, both new and old clients are supported.
Of course, you'll need hardware to test it.
Logitech mice are supported, otherwise any mouse that shows a
ResolutionMultiplier in the hid-recorder output (most Microsoft-branded mice of the last decade).
Or, if you happen to have an Apple Magic Mouse, I added support in the Kernel. You'll need to compile the Kernel with my patches, let me know if you need help.
For code reviewers
It's easier to review this PR commit by commit.