Ensure destroyed panel widgets remove the scrolled window

This commit is contained in:
Enrico Tröger 2009-05-03 21:13:54 +02:00 committed by Christian Dywan
parent 606c629fa5
commit 186c2d708b

View file

@ -542,7 +542,8 @@ static void
midori_panel_viewable_destroy_cb (GtkWidget* viewable, midori_panel_viewable_destroy_cb (GtkWidget* viewable,
MidoriPanel* panel) MidoriPanel* panel)
{ {
gint i = gtk_notebook_page_num (GTK_NOTEBOOK (panel->notebook), viewable); gint i = gtk_notebook_page_num (GTK_NOTEBOOK (panel->notebook),
g_object_get_data (G_OBJECT (viewable), "parent"));
if (i > -1) if (i > -1)
gtk_notebook_remove_page (GTK_NOTEBOOK (panel->notebook), i); gtk_notebook_remove_page (GTK_NOTEBOOK (panel->notebook), i);
g_signal_handlers_disconnect_by_func ( g_signal_handlers_disconnect_by_func (
@ -667,6 +668,7 @@ midori_panel_append_page (MidoriPanel* panel,
G_CALLBACK (midori_panel_widget_destroy_cb), menuitem); G_CALLBACK (midori_panel_widget_destroy_cb), menuitem);
} }
g_object_set_data (G_OBJECT (viewable), "parent", scrolled);
g_signal_connect (viewable, "destroy", g_signal_connect (viewable, "destroy",
G_CALLBACK (midori_panel_viewable_destroy_cb), panel); G_CALLBACK (midori_panel_viewable_destroy_cb), panel);