From 186c2d708b2f971fe2eadcd913b47ea8781a6b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 3 May 2009 21:13:54 +0200 Subject: [PATCH] Ensure destroyed panel widgets remove the scrolled window --- midori/midori-panel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/midori/midori-panel.c b/midori/midori-panel.c index e96bc600..5e19a327 100644 --- a/midori/midori-panel.c +++ b/midori/midori-panel.c @@ -542,9 +542,10 @@ static void midori_panel_viewable_destroy_cb (GtkWidget* viewable, 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) - gtk_notebook_remove_page (GTK_NOTEBOOK (panel->notebook), i); + gtk_notebook_remove_page (GTK_NOTEBOOK (panel->notebook), i); g_signal_handlers_disconnect_by_func ( viewable, midori_panel_viewable_destroy_cb, panel); } @@ -667,6 +668,7 @@ midori_panel_append_page (MidoriPanel* panel, G_CALLBACK (midori_panel_widget_destroy_cb), menuitem); } + g_object_set_data (G_OBJECT (viewable), "parent", scrolled); g_signal_connect (viewable, "destroy", G_CALLBACK (midori_panel_viewable_destroy_cb), panel);