gtkeventcontrollerscroll: Send lores scroll in the middle of the detent
authorJosé Expósito <jose.exposito89@gmail.com>
Mon, 17 Oct 2022 17:10:37 +0000 (19:10 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 24 May 2023 13:42:49 +0000 (13:42 +0000)
commite61938793a5e6a090d7e30ee0af0c4ed98b7d38e
tree31fb54d58c19b9836ce1dc0137a7cfbef56c09d6
parent2f584c16f0c8f116db02c470861b037dc7e53826
gtkeventcontrollerscroll: Send lores scroll in the middle of the detent

Some mice send a value slightly lower than 120 for some detents. The
current approach waits until a value of 120 is reached before sending a
low-resolution scroll event.

For example, the MX Master 3 sends a value of 112 in some detents:

              detent                   detent
    |                        |                       |
                        ^    ^                    ^
                        112  REL_WHEEL            224

As illustrated, only one event was sent but two were expected. However,
sending the low-resolution scroll event in the middle plus the existing
heuristics to reset the accumulator solve this issue:

              detent                   detent
    |                        |                       |
                ^          ^             ^          ^
                REL_WHEEL  112           REL_WHEEL  224

Send low-resolution scroll events in the middle of the detent to solve
this problem.

Related to https://gitlab.gnome.org/GNOME/mutter/-/issues/2469
gtk/gtkeventcontrollerscroll.c