diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2020-12-25 22:58:06 +0500 |
---|---|---|
committer | Alexander Mikhaylenko <alexm@gnome.org> | 2021-01-29 12:01:34 +0500 |
commit | 11f3b7730c278c1d58335896441c285091b5b740 (patch) | |
tree | e5b649b803bdae102087e670d20ee7f9bf2d6b26 | |
parent | f63e6394ac32c9cbc85a344e1b22cbbd3188d7ee (diff) | |
download | gtk+-wip/exalm/consumes-motion.tar.gz |
windowhandle: Use drag threshold instead of double click thresholdwip/exalm/consumes-motion
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
-rw-r--r-- | gtk/gtkwindowhandle.c | 12 |
1 files 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; |