mirror of
https://github.com/brl/mutter.git
synced 2025-03-10 13:25:05 +00:00

When a remote desktop user emits a virtual smooth scrolling event, a smooth scroll event, that is not emulated, is emitted and on occasion a discrete scroll event, that is emulated, is emitted. As base for the discrete scrolling event, the smooth scrolling steps are accumulated. When the accumulated smooth scrolling steps surpass the DISCRETE_SCROLL_STEP, the discrete scrolling event is emitted. Currently, mutter uses for DISCRETE_SCROLL_STEP the value 10, which is a terrible value to work with, especially for high resolution mouse wheels. When a triple resolution mouse wheel is used, each scrolling step will have the value 3 1/3. Three of such events won't however surpass the DISCRETE_SCROLL_STEP. To fix this situation, add DBL_EPSILON to the calculation step, when checking for the discrete scroll event to ensure that 3 smooth scroll events, with each having the value 3 1/3, emit a discrete scrolling event. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1727>