summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-22 14:11:05 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-03-22 14:11:05 -0400
commita957d4593e80f643c8de58c49542f69346a4a1fc (patch)
tree238a2142744c5ef9eec430583ae026a41b3c723f
parent3c7b29098ca0c2074ab5e20b9fe661954c7741a7 (diff)
downloadgtk+-a957d4593e80f643c8de58c49542f69346a4a1fc.tar.gz
Prevent the destruction of the menu label on page removal
In certain cases the menu label of a notebook page will be reused after the page was removed from the notebook, for instance when a page is dragged from one notebook to another. For such cases make sure that the menu label isn't destroyed as part of destroying the menu item it was in.
-rw-r--r--gtk/gtknotebook.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index a7c1b3a646..d038cc5f53 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -4656,17 +4656,20 @@ gtk_notebook_real_remove (GtkNotebook *notebook,
if (destroying)
gtk_widget_destroy (tab_label);
g_object_unref (tab_label);
- }
+ }
if (notebook->menu)
{
- gtk_container_remove (GTK_CONTAINER (notebook->menu),
- page->menu_label->parent);
+ GtkWidget *parent = page->menu_label->parent;
+
+ gtk_notebook_menu_label_unparent (parent, NULL);
+ gtk_container_remove (GTK_CONTAINER (notebook->menu), parent);
+
gtk_widget_queue_resize (notebook->menu);
}
if (!page->default_menu)
g_object_unref (page->menu_label);
-
+
g_list_free (list);
if (page->last_focus_child)