From d7e10b81a7d8b2cef33a902d9f672e774b672aa8 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 4 Sep 2003 13:46:49 +0000 Subject: Use x,y only on drop, otherwise they are invalid. Damn that api suck. 2003-09-04 Marco Pesenti Gritti * lib/widgets/ephy-node-view.c: (drag_data_received_cb): Use x,y only on drop, otherwise they are invalid. Damn that api suck. --- lib/widgets/ephy-node-view.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'lib') diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index 901f44990..43bb7947b 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -433,17 +433,14 @@ drag_data_received_cb (GtkWidget *widget, guint32 time, EphyNodeView *view) { - GtkTreePath *path; GtkTreeViewDropPosition pos; - gboolean on_row; + + /* x and y here are valid only on drop ! */ if (selection_data->length <= 0 || selection_data->data == NULL) { return; - } - - on_row = gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), - x, y, &path, &pos); + } if (!view->priv->have_drag_data) { @@ -457,6 +454,11 @@ drag_data_received_cb (GtkWidget *widget, EphyNode *node; GList *uris; gboolean success = FALSE; + gboolean on_row; + GtkTreePath *path; + + on_row = gtk_tree_view_get_dest_row_at_pos + (GTK_TREE_VIEW (widget), x, y, &path, &pos); g_return_if_fail (on_row && path != NULL); @@ -476,13 +478,14 @@ drag_data_received_cb (GtkWidget *widget, view->priv->drop_occurred = FALSE; free_drag_data (view); gtk_drag_finish (context, success, FALSE, time); - } - if (path) - { - gtk_tree_path_free (path); + if (path) + { + gtk_tree_path_free (path); + } } + /* appease GtkTreeView by preventing its drag_data_receive * from being called */ g_signal_stop_emission_by_name (GTK_TREE_VIEW (view), -- cgit v1.2.3