aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-03-14 09:01:03 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-03-14 09:01:03 +0800
commit473bd44d6460ff9e71844a5d7a5895e547be26b5 (patch)
tree55808cce66cdf0ccb9554d7defc7e0c32c0a18e7
parent2384f5872c8a4f3f400b3be011bcaa5e9a77cfac (diff)
downloadgsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.tar
gsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.tar.gz
gsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.tar.bz2
gsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.tar.lz
gsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.tar.xz
gsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.tar.zst
gsoc2013-epiphany-473bd44d6460ff9e71844a5d7a5895e547be26b5.zip
Deal with the case where data_received signal is emitted asyncrounously.
2004-03-14 Marco Pesenti Gritti <marco@gnome.org> * lib/egg/egg-editable-toolbar.c: (drag_data_received_cb), (toolbar_drag_motion_cb), (egg_editable_toolbar_init): Deal with the case where data_received signal is emitted asyncrounously.
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/egg/egg-editable-toolbar.c22
2 files changed, 17 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 99203454a..fe281ed79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-03-14 Marco Pesenti Gritti <marco@gnome.org>
+
+ * lib/egg/egg-editable-toolbar.c: (drag_data_received_cb),
+ (toolbar_drag_motion_cb), (egg_editable_toolbar_init):
+
+ Deal with the case where data_received signal is emitted
+ asyncrounously.
+
2004-03-13 Alexander Shopov <ash@contact.bg>
* configure.in: Added bg to ALL_LINGUAS.
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index aa8e2d8cb..57c2681a8 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -450,6 +450,8 @@ drag_data_received_cb (GtkWidget *widget,
etoolbar->priv->pending = FALSE;
etoolbar->priv->dragged_item =
create_item_from_action (etoolbar, id, data_is_separator (id), NULL);
+ g_object_ref (etoolbar->priv->dragged_item);
+ gtk_object_sink (GTK_OBJECT (etoolbar->priv->dragged_item));
}
else
{
@@ -595,23 +597,16 @@ toolbar_drag_motion_cb (GtkWidget *widget,
etoolbar->priv->target_toolbar = toolbar;
- /* The handler will make sure the item is created */
gtk_drag_get_data (widget, context, target, time);
-
- g_assert (!etoolbar->priv->pending);
-
- if (etoolbar->priv->dragged_item == NULL) {
- return TRUE;
- }
-
- g_object_ref (etoolbar->priv->dragged_item);
- gtk_object_sink (GTK_OBJECT (etoolbar->priv->dragged_item));
}
- item = GTK_TOOL_ITEM (etoolbar->priv->dragged_item);
+ if (etoolbar->priv->dragged_item != NULL)
+ {
+ item = GTK_TOOL_ITEM (etoolbar->priv->dragged_item);
- index = gtk_toolbar_get_drop_index (toolbar, x, y);
- gtk_toolbar_set_drop_highlight_item (toolbar, item, index);
+ index = gtk_toolbar_get_drop_index (toolbar, x, y);
+ gtk_toolbar_set_drop_highlight_item (toolbar, item, index);
+ }
gdk_drag_status (context, context->suggested_action, time);
@@ -1053,6 +1048,7 @@ egg_editable_toolbar_init (EggEditableToolbar *t)
t->priv->merge = NULL;
t->priv->edit_mode = FALSE;
+ t->priv->dragged_item = NULL;
}
static void