From 33db142eab6978b10ec6d668cebdbd88dca8d723 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 28 Feb 2022 20:27:43 +0100 Subject: [PATCH] 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 --- gtk/gtkscrolledwindow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 1842dcd528..4879fee68d 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -1052,7 +1052,8 @@ gtk_scrolled_window_decelerate (GtkScrolledWindow *scrolled_window, if (priv->x_velocity != 0 || priv->y_velocity != 0 || overshoot) { - gtk_scrolled_window_start_deceleration (scrolled_window); + if (priv->deceleration_id == 0) + gtk_scrolled_window_start_deceleration (scrolled_window); priv->x_velocity = priv->y_velocity = 0; } }