[gtk+] scrolledwindow: Cancel kinetic/overshoot animation on captured scroll events



commit 3ccfcf5b9f0285be7b2423a22f17a2eaea774f49
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Mar 2 17:01:21 2015 +0100

    scrolledwindow: Cancel kinetic/overshoot animation on captured scroll events
    
    This ensures the animation is cancelled if the child widget happens to
    GDK_EVENT_STOP scroll events.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745315

 gtk/gtkscrolledwindow.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 893a1ac..88ba47d 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1071,6 +1071,12 @@ captured_event_cb (GtkWidget *widget,
   sw = GTK_SCROLLED_WINDOW (widget);
   priv = sw->priv;
 
+  if (event->type == GDK_SCROLL)
+    {
+      gtk_scrolled_window_cancel_deceleration (sw);
+      return GDK_EVENT_PROPAGATE;
+    }
+
   if (!priv->use_indicators)
     return GDK_EVENT_PROPAGATE;
 
@@ -2993,7 +2999,6 @@ gtk_scrolled_window_scroll_event (GtkWidget      *widget,
 
   if (handled)
     {
-      gtk_scrolled_window_cancel_deceleration (scrolled_window);
       gtk_scrolled_window_invalidate_overshoot (scrolled_window);
 
       if (priv->scroll_events_overshoot_id)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]