diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2021-01-19 13:00:02 +0500 |
---|---|---|
committer | Alexander Mikhaylenko <alexm@gnome.org> | 2021-01-29 12:00:10 +0500 |
commit | bbca4c38dfef37cabd2c0d0c37ad63a99bed4125 (patch) | |
tree | c21b2cdd181f3b880b7e6dec010c228da9d044c7 | |
parent | 28f5d267196e0624422e06f1f18df7d9d3a2d1ab (diff) | |
download | gtk+-bbca4c38dfef37cabd2c0d0c37ad63a99bed4125.tar.gz |
entry: Fix drag threshold check
It was passing offsets as current oordinates.
-rw-r--r-- | gtk/gtkentry.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 791886cced..6a5d5cc6a1 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1586,32 +1586,33 @@ icon_released_cb (GtkGestureClick *gesture, static void icon_drag_update_cb (GtkGestureDrag *gesture, - double x, - double y, + double offset_x, + double offset_y, GtkEntry *entry) { GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry); - double start_x, start_y; GtkEntryIconPosition pos; EntryIconInfo *icon_info; - gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y); pos = get_icon_position_from_controller (entry, GTK_EVENT_CONTROLLER (gesture)); icon_info = priv->icons[pos]; if (icon_info->content != NULL && - gtk_drag_check_threshold (icon_info->widget, start_x, start_y, x, y)) + gtk_drag_check_threshold (icon_info->widget, 0, 0, offset_x, offset_y)) { GdkPaintable *paintable; GdkSurface *surface; GdkDevice *device; GdkDrag *drag; + double start_x, start_y; icon_info->in_drag = TRUE; surface = gtk_native_get_surface (gtk_widget_get_native (GTK_WIDGET (entry))); device = gtk_gesture_get_device (GTK_GESTURE (gesture)); + gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y); + drag = gdk_drag_begin (surface, device, icon_info->content, icon_info->actions, start_x, start_y); paintable = gtk_widget_paintable_new (icon_info->widget); gtk_drag_icon_set_from_paintable (drag, paintable, -2, -2); |