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.
This commit is contained in:
Alexander Mikhaylenko 2021-07-07 19:39:06 +05:00
parent 5ef2b9fd54
commit fe633d9ef9

View File

@ -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;