aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-09-04 21:46:49 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-09-04 21:46:49 +0800
commitd7e10b81a7d8b2cef33a902d9f672e774b672aa8 (patch)
treecfb74ee784f302a6b922bde65a3eb0f52c56cbfc
parenta16915c7337f69679aca212484a5f9568decb217 (diff)
downloadgsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.tar
gsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.tar.gz
gsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.tar.bz2
gsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.tar.lz
gsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.tar.xz
gsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.tar.zst
gsoc2013-epiphany-d7e10b81a7d8b2cef33a902d9f672e774b672aa8.zip
Use x,y only on drop, otherwise they are invalid. Damn that api suck.
2003-09-04 Marco Pesenti Gritti <marco@gnome.org> * lib/widgets/ephy-node-view.c: (drag_data_received_cb): Use x,y only on drop, otherwise they are invalid. Damn that api suck.
-rw-r--r--ChangeLog7
-rw-r--r--lib/widgets/ephy-node-view.c23
2 files changed, 20 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b4a6d92f..d2ab5d669 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-09-04 Marco Pesenti Gritti <marco@gnome.org>
+ * lib/widgets/ephy-node-view.c: (drag_data_received_cb):
+
+ Use x,y only on drop, otherwise they are invalid. Damn
+ that api suck.
+
+2003-09-04 Marco Pesenti Gritti <marco@gnome.org>
+
* data/ui/epiphany-history-window-ui.xml.in:
Fix a typo in the xml
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),