diff options
author | Benjamin Otte <otte@redhat.com> | 2018-05-17 04:51:18 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2018-06-18 23:49:52 +0200 |
commit | b00609c21c388cd4353cabf6290d85bd7277a3d9 (patch) | |
tree | 3333132cd478da5ba923bbb4b7ff2e8ac20a522d /gtk/gtknotebook.c | |
parent | 6d7cb2b78195e486995e0f4f821e8e17b0b89eea (diff) | |
download | gtk+-b00609c21c388cd4353cabf6290d85bd7277a3d9.tar.gz |
dnd: Make drag-motion and drag-drop signals use GdkDrop
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r-- | gtk/gtknotebook.c | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index a30060de06..b9e3b81ba2 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -392,17 +392,15 @@ static gboolean gtk_notebook_drag_failed (GtkWidget *widget, GdkDragContext *context, GtkDragResult result); static gboolean gtk_notebook_drag_motion (GtkWidget *widget, - GdkDragContext *context, + GdkDrop *drop, gint x, - gint y, - guint time); + gint y); static void gtk_notebook_drag_leave (GtkWidget *widget, GdkDrop *drop); static gboolean gtk_notebook_drag_drop (GtkWidget *widget, - GdkDragContext *context, + GdkDrop *drop, gint x, - gint y, - guint time); + gint y); static void gtk_notebook_drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *data, @@ -3018,11 +3016,10 @@ gtk_notebook_switch_tab_timeout (gpointer data) } static gboolean -gtk_notebook_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) +gtk_notebook_drag_motion (GtkWidget *widget, + GdkDrop *drop, + gint x, + gint y) { GtkNotebook *notebook = GTK_NOTEBOOK (widget); GtkNotebookPrivate *priv = notebook->priv; @@ -3037,14 +3034,14 @@ gtk_notebook_drag_motion (GtkWidget *widget, { priv->click_child = arrow; gtk_notebook_set_scroll_timer (notebook); - gdk_drag_status (context, 0, time); + gdk_drop_status (drop, 0); retval = TRUE; goto out; } stop_scrolling (notebook); - target = gtk_drag_dest_find_target (widget, context, NULL); + target = gtk_drag_dest_find_target (widget, drop, NULL); tab_target = g_intern_static_string ("GTK_NOTEBOOK_TAB"); if (target == tab_target) @@ -3055,7 +3052,7 @@ gtk_notebook_drag_motion (GtkWidget *widget, retval = TRUE; - source = GTK_NOTEBOOK (gtk_drag_get_source_widget (context)); + source = GTK_NOTEBOOK (gtk_drag_get_source_widget (gdk_drop_get_drag (drop))); g_assert (source->priv->cur_page != NULL); source_child = source->priv->cur_page->child; @@ -3066,14 +3063,14 @@ gtk_notebook_drag_motion (GtkWidget *widget, !(widget == source_child || gtk_widget_is_ancestor (widget, source_child))) { - gdk_drag_status (context, GDK_ACTION_MOVE, time); + gdk_drop_status (drop, GDK_ACTION_MOVE); goto out; } else { /* it's a tab, but doesn't share * ID with this notebook */ - gdk_drag_status (context, 0, time); + gdk_drop_status (drop, 0); } } @@ -3117,23 +3114,22 @@ gtk_notebook_drag_leave (GtkWidget *widget, } static gboolean -gtk_notebook_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) +gtk_notebook_drag_drop (GtkWidget *widget, + GdkDrop *drop, + gint x, + gint y) { GtkNotebook *notebook = GTK_NOTEBOOK (widget); GdkAtom target, tab_target; - target = gtk_drag_dest_find_target (widget, context, NULL); + target = gtk_drag_dest_find_target (widget, drop, NULL); tab_target = g_intern_static_string ("GTK_NOTEBOOK_TAB"); if (target == tab_target) { notebook->priv->mouse_x = x; notebook->priv->mouse_y = y; - gtk_drag_get_data (widget, context, target, time); + gtk_drag_get_data (widget, drop, target); return TRUE; } |