Disconnect panel toolitem destroy handler when detaching

This commit is contained in:
Christian Dywan 2009-04-26 17:11:16 +02:00
parent bdf9c2c11d
commit 62edfeb06e

View file

@ -218,6 +218,15 @@ midori_panel_detached_window_delete_event_cb (GtkWidget* window,
return FALSE;
}
static void
midori_panel_widget_destroy_cb (GtkWidget* viewable,
GtkWidget* widget)
{
gtk_widget_destroy (widget);
g_signal_handlers_disconnect_by_func (
viewable, midori_panel_widget_destroy_cb, widget);
}
static void
midori_panel_button_detach_clicked_cb (GtkWidget* toolbutton,
MidoriPanel* panel)
@ -246,6 +255,9 @@ midori_panel_button_detach_clicked_cb (GtkWidget* toolbutton,
gtk_container_add (GTK_CONTAINER (window), vbox);
if (menuitem)
gtk_widget_hide (menuitem);
g_signal_handlers_disconnect_by_func (
_midori_panel_child_for_scrolled (panel, scrolled),
midori_panel_widget_destroy_cb, toolitem);
gtk_container_remove (GTK_CONTAINER (panel->toolbar), GTK_WIDGET (toolitem));
g_object_ref (toolbar);
gtk_container_remove (GTK_CONTAINER (panel->toolbook), toolbar);
@ -537,15 +549,6 @@ midori_panel_viewable_destroy_cb (GtkWidget* viewable,
viewable, midori_panel_viewable_destroy_cb, panel);
}
static void
midori_panel_widget_destroy_cb (GtkWidget* viewable,
GtkWidget* widget)
{
gtk_widget_destroy (widget);
g_signal_handlers_disconnect_by_func (
viewable, midori_panel_widget_destroy_cb, widget);
}
static GtkToolItem*
midori_panel_construct_tool_item (MidoriPanel* panel,
MidoriViewable* viewable)