diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-10-31 00:32:14 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-10-31 00:32:14 +0800 |
commit | beb24485f79f1131be3d5fa006447d57e5be6873 (patch) | |
tree | 249fbc7fe33a3452a4953ba927bc513ee114fb6d /lib/egg | |
parent | a28245ea668203b1b2ffabb0b054660e88986a3f (diff) | |
download | gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.tar gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.tar.gz gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.tar.bz2 gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.tar.lz gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.tar.xz gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.tar.zst gsoc2013-epiphany-beb24485f79f1131be3d5fa006447d57e5be6873.zip |
Fix creation of special drag types items
2003-10-30 Marco Pesenti Gritti <marco@gnome.org>
* lib/egg/egg-editable-toolbar.c: (drag_data_received_cb):
Fix creation of special drag types items
Diffstat (limited to 'lib/egg')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c index 3849b356c..f9f139422 100755 --- a/lib/egg/egg-editable-toolbar.c +++ b/lib/egg/egg-editable-toolbar.c @@ -391,6 +391,16 @@ drag_data_received_cb (GtkWidget *widget, guint time, EggEditableToolbar *etoolbar) { + char *type; + char *id; + + GdkAtom target; + + target = gtk_drag_dest_find_target (widget, context, NULL); + type = egg_toolbars_model_get_item_type (etoolbar->priv->model, target); + id = egg_toolbars_model_get_item_id (etoolbar->priv->model, type, + selection_data->data); + /* This function can be called for two reasons * * (1) drag_motion() needs an item to pass to @@ -406,8 +416,7 @@ drag_data_received_cb (GtkWidget *widget, { etoolbar->priv->pending = FALSE; etoolbar->priv->dragged_item = - create_item_from_action (etoolbar, selection_data->data, - data_is_separator (selection_data->data)); + create_item_from_action (etoolbar, id, data_is_separator (id)); } else { @@ -423,11 +432,6 @@ drag_data_received_cb (GtkWidget *widget, } else { - GdkAtom target; - char *type; - char *id; - - target = gtk_drag_dest_find_target (widget, context, NULL); type = egg_toolbars_model_get_item_type (etoolbar->priv->model, target); id = egg_toolbars_model_get_item_id (etoolbar->priv->model, type, @@ -435,13 +439,14 @@ drag_data_received_cb (GtkWidget *widget, egg_toolbars_model_add_item (etoolbar->priv->model, toolbar_pos, pos, id, type); - g_free (type); - g_free (id); } gtk_drag_finish (context, TRUE, context->action == GDK_ACTION_MOVE, time); } + + g_free (type); + g_free (id); } static void |