[gtk/dnd-gestures-2] treeview: Stop using ::drag-data-received
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures-2] treeview: Stop using ::drag-data-received
- Date: Fri, 3 Jan 2020 21:45:49 +0000 (UTC)
commit f7d05641b62498da51dff3a2c7f03c1d16bef26f
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 3 16:15:22 2020 -0500
treeview: Stop using ::drag-data-received
gtk/gtktreeview.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index c28ce05dee..450c10edea 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -696,9 +696,9 @@ static gboolean gtk_tree_view_drag_drop (GtkDropTarget *dest,
int x,
int y,
GtkTreeView *tree_view);
-static void gtk_tree_view_drag_data_received (GtkDropTarget *dest,
- GtkSelectionData *selection_data,
- GtkTreeView *tree_view);
+static void gtk_tree_view_drag_data_received (GObject *source,
+ GAsyncResult *result,
+ gpointer data);
/* tree_model signals */
static gboolean gtk_tree_view_real_move_cursor (GtkTreeView *tree_view,
@@ -7327,7 +7327,7 @@ gtk_tree_view_drag_motion (GtkDropTarget *dest,
* determining whether to accept the drop
*/
set_status_pending (drop, suggested_action);
- gtk_drag_get_data (GTK_WIDGET (tree_view), drop, target);
+ gtk_drop_target_read_selection (dest, target, NULL, gtk_tree_view_drag_data_received, tree_view);
}
else
{
@@ -7397,7 +7397,7 @@ gtk_tree_view_drag_drop (GtkDropTarget *dest,
if (target != NULL)
{
- gtk_drag_get_data (GTK_WIDGET (tree_view), drop, target);
+ gtk_drop_target_read_selection (dest, target, NULL, gtk_tree_view_drag_data_received, tree_view);
return TRUE;
}
else
@@ -7432,10 +7432,12 @@ gtk_tree_view_get_action (GtkWidget *widget,
}
static void
-gtk_tree_view_drag_data_received (GtkDropTarget *dest,
- GtkSelectionData *selection_data,
- GtkTreeView *tree_view)
+gtk_tree_view_drag_data_received (GObject *source,
+ GAsyncResult *result,
+ gpointer data)
{
+ GtkDropTarget *dest = GTK_DROP_TARGET (source);
+ GtkTreeView *tree_view = GTK_TREE_VIEW (data);
GdkDrop *drop = gtk_drop_target_get_drop (dest);
GtkTreePath *path;
TreeViewDragInfo *di;
@@ -7444,6 +7446,9 @@ gtk_tree_view_drag_data_received (GtkDropTarget *dest,
GdkDragAction suggested_action;
gboolean path_down_mode;
gboolean drop_append_mode;
+ GtkSelectionData *selection_data;
+
+ selection_data = gtk_drop_target_read_selection_finish (dest, result, NULL);
model = gtk_tree_view_get_model (tree_view);
@@ -12961,7 +12966,6 @@ gtk_tree_view_enable_model_drag_dest (GtkTreeView *tree_view,
g_signal_connect (di->dest, "drag-leave", G_CALLBACK (gtk_tree_view_drag_leave), tree_view);
g_signal_connect (di->dest, "drag-motion", G_CALLBACK (gtk_tree_view_drag_motion), tree_view);
g_signal_connect (di->dest, "drag-drop", G_CALLBACK (gtk_tree_view_drag_drop), tree_view);
- g_signal_connect (di->dest, "drag-data-received", G_CALLBACK (gtk_tree_view_drag_data_received),
tree_view);
gtk_drop_target_attach (di->dest, GTK_WIDGET (tree_view));
unset_reorderable (tree_view);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]