macos: fix kinetic scrolling with overshoot
authorChristian Hergert <christian@hergert.me>
Fri, 25 Feb 2022 02:55:42 +0000 (18:55 -0800)
committerChristian Hergert <christian@hergert.me>
Fri, 25 Feb 2022 02:58:48 +0000 (18:58 -0800)
commitf278f3610bdce090f1515b633d5473cd1674e2bc
tree06e6c112f4a51f7caad3d05c9a4ad71239c33e94
parent617deb8bb6cd375833517464a1ba0d2220c4266c
macos: fix kinetic scrolling with overshoot

Previously we had issues on macos where the overshoot would keep showing.
To fix this we need to actually use discrete events instead of the
generated deltas from macOS in the scroll wheel case. Additionally, we need
to drop the kinetic momentum events from macOS and rely on the gtk kinetic
events which are already happening anyway. We also need to submit the
is_stop event for the GDK_SCROLL_SMOOTH case when we detect it.

To keep the discrete scroll events correct, we need to alter the hack in
gtkscrolledwindow.c to use the same path as other platforms except for
when a smooth scroll event is in place. In the future, I would imagine that
this falls into the boundary of high-precision scrolling and would share
the same code paths as other platforms.

With all of these in place, kinetic scrolling with overshoot appears the
same on macOS as other platforms.
gdk/macos/gdkmacosdisplay-translate.c
gtk/gtkscrolledwindow.c