Low res scroll events on high resolution mouse wheel sometimes skip mouse detents.
Affected version
- mutter / gnome-shell 43.0 (regression from 42.x)
- libinput 1.21.0
- linux kernel 6.0.1
Bug summary
I have a Logitech MX Master 3 mouse. This mouse uses the "magspeed" wheel which supports high resolution scrolling. It can be switched (and auto-switches on the fly) between free-spinning, and having detents enabled.
In applications that support high res scrolling, everything is great - however, a lot of applications still rely on the low res wheel events, and I often see skipped detents. I.e. I scroll one detent, and nothing happens.
Example affected applications:
- gnome-shell workspace switcher and application grid page switcher
- firefox
- gnome-terminal (gtk3)
I have attached a trace made using 'libinput record' using this mouse. In this trace, I scroll one detent, then wait 2-3 seconds, then scroll one detent. This is repeated several times. The full log is attached: mx-master-3-scroll.yml
A typical single-detent step looks like this:
- evdev:
- [ 2, 561979, 2, 11, -24] # EV_REL / REL_WHEEL_HI_RES -24
- [ 2, 561979, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +8ms
# Scrolling one detent starts here
- evdev:
- [ 5, 543971, 2, 11, -16] # EV_REL / REL_WHEEL_HI_RES -16
- [ 5, 543971, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +2982ms
- evdev:
- [ 5, 745974, 2, 11, -16] # EV_REL / REL_WHEEL_HI_RES -16
- [ 5, 745974, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +202ms
- evdev:
- [ 5, 779971, 2, 11, -16] # EV_REL / REL_WHEEL_HI_RES -16
- [ 5, 779971, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +34ms
- evdev:
- [ 5, 793965, 2, 11, -24] # EV_REL / REL_WHEEL_HI_RES -24
- [ 5, 793965, 2, 8, -1] # EV_REL / REL_WHEEL -1
- [ 5, 793965, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +14ms
- evdev:
- [ 5, 801966, 2, 11, -16] # EV_REL / REL_WHEEL_HI_RES -16
- [ 5, 801966, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +8ms
- evdev:
- [ 5, 809963, 2, 11, -24] # EV_REL / REL_WHEEL_HI_RES -24
- [ 5, 809963, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +8ms
# Scrolling one detent stops here
- evdev:
- [ 8, 978304, 2, 11, -16] # EV_REL / REL_WHEEL_HI_RES -16
- [ 8, 978304, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +3169ms
You'll notice the following things:
- During this single-detent scroll, only 112 units of high res scroll events were received, not 120! (I believe over the long term this mouse does average 120 per detent, but haven't actually checked that...)
- The hardware provides a low-res scroll event alongside the high-res events. The low-res scroll event is consistently aligned to always happen midway along the travel from one detent to the next, even if the wheel is unlocked (set to freespin) and then locked again (detents re-enabled).
With the older version, it seems like only the hardware low-res events were used, which work perfectly and are always aligned with the detents. Something seems to have changed with the newer gnome version such that these hardware low res events are no longer used to inform applications about discrete scrolling steps.