[gtk/wip/exalm/scroll-touch] scrolledwindow: Don't check drag threshold when already scrolling




commit fe633d9ef9b4c0d2f043bf2eb4c0edcdd0f9bfd3
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Jul 7 19:39:06 2021 +0500

    scrolledwindow: Don't check drag threshold when already scrolling
    
    Checkout the drag threshold only makes sense when starting a scroll, after
    that it just adds jumps when trying to scroll back and forth.

 gtk/gtkscrolledwindow.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 058cff7921..2df696234c 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -987,11 +987,15 @@ scrolled_window_drag_update_cb (GtkScrolledWindow *scrolled_window,
                                 GtkGesture        *gesture)
 {
   GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window);
+  GdkEventSequence *sequence;
   GtkAdjustment *hadjustment;
   GtkAdjustment *vadjustment;
   double dx, dy;
 
-  if (!gtk_drag_check_threshold_double (GTK_WIDGET (scrolled_window),
+  sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
+
+  if (gtk_gesture_get_sequence_state (gesture, sequence) != GTK_EVENT_SEQUENCE_CLAIMED &&
+      !gtk_drag_check_threshold_double (GTK_WIDGET (scrolled_window),
                                         0, 0, offset_x, offset_y))
     return;
 


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