[gtk/wip/exalm/consumes-motion: 127/127] windowhandle: Use drag threshold instead of double click threshold




commit 11f3b7730c278c1d58335896441c285091b5b740
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Fri Dec 25 22:58:06 2020 +0500

    windowhandle: Use drag threshold instead of double click threshold
    
    Now that we have gtk_drag_check_threshold_double(), be consistent with
    other draggable widgets and make sure we don't take over a drag before a
    child does.
    
    Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3513

 gtk/gtkwindowhandle.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkwindowhandle.c b/gtk/gtkwindowhandle.c
index f4f2fa6e49..a4265df7c7 100644
--- a/gtk/gtkwindowhandle.c
+++ b/gtk/gtkwindowhandle.c
@@ -24,6 +24,7 @@
 #include "gtkbinlayout.h"
 #include "gtkbox.h"
 #include "gtkbuildable.h"
+#include "gtkdragsourceprivate.h"
 #include "gtkgestureclick.h"
 #include "gtkgesturedrag.h"
 #include "gtkgestureprivate.h"
@@ -388,16 +389,7 @@ drag_gesture_update_cb (GtkGestureDrag  *gesture,
                         double           offset_y,
                         GtkWindowHandle *self)
 {
-  int double_click_distance;
-  GtkSettings *settings;
-
-  settings = gtk_widget_get_settings (GTK_WIDGET (self));
-  g_object_get (settings,
-                "gtk-double-click-distance", &double_click_distance,
-                NULL);
-
-  if (ABS (offset_x) > double_click_distance ||
-      ABS (offset_y) > double_click_distance)
+  if (gtk_drag_check_threshold_double (GTK_WIDGET (self), 0, 0, offset_x, offset_y))
     {
       double start_x, start_y;
       double native_x, native_y;


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