[gtk/wip/otte/gleanup: 2/48] scrolledwindow: Don't check drag threshold when already scrolling
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/gleanup: 2/48] scrolledwindow: Don't check drag threshold when already scrolling
- Date: Sat, 10 Jul 2021 01:51:21 +0000 (UTC)
commit b8c8b9f6fbe506f83b2a2b4159610be4b6f549db
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]