summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-05-16 04:50:24 +0200
committerBenjamin Otte <otte@redhat.com>2018-06-18 23:49:52 +0200
commit6d7cb2b78195e486995e0f4f821e8e17b0b89eea (patch)
treecf40cdae75c44971b32744ef2fb1a2db9f03bd99 /gtk/gtknotebook.c
parenta862ca41c5645cb399ea3b439ba58e01cae32162 (diff)
downloadgtk+-6d7cb2b78195e486995e0f4f821e8e17b0b89eea.tar.gz
dnd: Make drag-data-received use a GdkDrop
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 5ceec449b1..a30060de06 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -408,9 +408,8 @@ static void gtk_notebook_drag_data_get (GtkWidget *widget,
GtkSelectionData *data,
guint time);
static void gtk_notebook_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *data,
- guint time);
+ GdkDrop *drop,
+ GtkSelectionData *data);
/*** GtkContainer Methods ***/
static void gtk_notebook_set_child_property (GtkContainer *container,
@@ -3246,27 +3245,29 @@ gtk_notebook_drag_data_get (GtkWidget *widget,
static void
gtk_notebook_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *data,
- guint time)
+ GdkDrop *drop,
+ GtkSelectionData *data)
{
GtkNotebook *notebook;
+ GdkDragContext *drag;
GtkWidget *source_widget;
GtkWidget **child;
notebook = GTK_NOTEBOOK (widget);
- source_widget = gtk_drag_get_source_widget (context);
+ drag = gdk_drop_get_drag (drop);
+ source_widget = gtk_drag_get_source_widget (drag);
if (source_widget &&
+ (gdk_drop_get_actions (drop) & GDK_ACTION_MOVE) &&
gtk_selection_data_get_target (data) == g_intern_static_string ("GTK_NOTEBOOK_TAB"))
{
child = (void*) gtk_selection_data_get_data (data);
do_detach_tab (GTK_NOTEBOOK (source_widget), notebook, *child);
- gdk_drag_finish (context, TRUE, time);
+ gdk_drop_finish (drop, GDK_ACTION_MOVE);
}
else
- gdk_drag_finish (context, FALSE, time);
+ gdk_drop_finish (drop, 0);
}
/* Private GtkContainer Methods :