wayland: Fix high-resolution scroll wheel discrete step calculation
Some wheels might send fewer or more than 120 fractions per step. In order to always register a discrete step, we count these as a step already at half(120/2) of one mouse wheel step in stepping mode. The timer resets the initial value of the step because the mouse can switch between free spin and stepping mode. When transitioning from free spin to stepping mode, the mouse calibrates its wheel position to the starting point and generates some fractions. As a result, our starting position can appear far from the zero point, potentially causing us to count two(or zero) steps instead of one. Additionally, the compositor might start when the mouse is in free spin mode(or the mouse could be connected in free spin mode), leading to the same issue. https://gitlab.freedesktop.org/libinput/libinput/-/issues/814 (cherry picked from commit 361e2c3e)
Please register or sign in to comment