gtkscrolledwindow: Do not try to doubly trigger deceleration

This may come from different sources at around the same time, e.g.
a hold gesture while on overshoot. Avoid doing that if an
animation is already set.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4730
This commit is contained in:
Carlos Garnacho 2022-02-28 20:27:43 +01:00
parent 68319afd23
commit 33db142eab

View File

@ -1052,6 +1052,7 @@ gtk_scrolled_window_decelerate (GtkScrolledWindow *scrolled_window,
if (priv->x_velocity != 0 || priv->y_velocity != 0 || overshoot) if (priv->x_velocity != 0 || priv->y_velocity != 0 || overshoot)
{ {
if (priv->deceleration_id == 0)
gtk_scrolled_window_start_deceleration (scrolled_window); gtk_scrolled_window_start_deceleration (scrolled_window);
priv->x_velocity = priv->y_velocity = 0; priv->x_velocity = priv->y_velocity = 0;
} }