From 79656340a04e8f7eb99264c840e3dd38c9ba66ba Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Wed, 21 Oct 2015 12:27:44 +0200 Subject: [PATCH] kinetic-scroll-view: don't propagate press events that stop a deceleration While the kinetic scroll view is still decelerating after a scroll, if another press event happens (be it a single press or another drag), this should stop the deceleration (as it already does) but the event should not be propagated. --- mx/mx-kinetic-scroll-view.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mx/mx-kinetic-scroll-view.c b/mx/mx-kinetic-scroll-view.c index 76d11163..ddfd2323 100644 --- a/mx/mx-kinetic-scroll-view.c +++ b/mx/mx-kinetic-scroll-view.c @@ -1504,6 +1504,7 @@ press_event (MxKineticScrollView *scroll, ClutterActor *actor = (ClutterActor *) scroll; ClutterActor *stage = clutter_actor_get_stage (actor); MxKineticScrollViewMotion *motion; + gboolean timeline_stopped = FALSE; /* Reset automatic-scroll setting */ priv->in_automatic_scroll = MX_AUTOMATIC_SCROLL_NONE; @@ -1530,6 +1531,7 @@ press_event (MxKineticScrollView *scroll, clutter_timeline_stop (priv->deceleration_timeline); g_object_unref (priv->deceleration_timeline); priv->deceleration_timeline = NULL; + timeline_stopped = TRUE; clamp_adjustments (scroll, priv->clamp_duration, priv->hmoving, priv->vmoving); @@ -1585,7 +1587,7 @@ press_event (MxKineticScrollView *scroll, priv->in_drag = FALSE; } - return FALSE; + return timeline_stopped; } static gboolean