From 030b62d122d825c3f043116bca29dd6cc7896210 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 7 Aug 2013 05:10:42 -0400 Subject: gtkdnd: Introduce a new API for more accurate drag origin data When trying to drag, we currently the position of the first motion event to determine where the drag came from. This might be alright in the case of the old animation, but the data will be inaccurate if the user has moved the pointer quite a bit since pressing the cursor to start dragging. While we could monkey patch the GdkEvent at the widget layer, this is unintuitive and strange. Add a new API that takes a set of pointer coordinates describing the origin of the drag. Additionally, adapt most widgets to use it and use it with correct coordinates. https://bugzilla.gnome.org/show_bug.cgi?id=705605 --- gtk/gtknotebook.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gtk/gtknotebook.c') diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index b44c84aac6..48a0580296 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3415,8 +3415,9 @@ gtk_notebook_motion_notify (GtkWidget *widget, priv->detached_tab = priv->cur_page; priv->during_detach = TRUE; - gtk_drag_begin (widget, priv->source_targets, GDK_ACTION_MOVE, - priv->pressed_button, (GdkEvent*) event); + gtk_drag_begin_with_coordinates (widget, priv->source_targets, GDK_ACTION_MOVE, + priv->pressed_button, (GdkEvent*) event, + priv->drag_begin_x, priv->drag_begin_y); return TRUE; } -- cgit v1.2.1