Don't destroy inspector window that will be re-used

This commit is contained in:
André Stösel 2011-04-19 23:21:31 +02:00 committed by Christian Dywan
parent a2fc8f405c
commit a9a220f96c
2 changed files with 3 additions and 1 deletions

View file

@ -1262,9 +1262,11 @@ midori_view_detach_inspector_cb (GtkWidget* view,
MidoriBrowser* browser) MidoriBrowser* browser)
{ {
GtkWidget* scrolled = gtk_widget_get_parent (GTK_WIDGET (inspector_view)); GtkWidget* scrolled = gtk_widget_get_parent (GTK_WIDGET (inspector_view));
GtkWidget* paned = gtk_widget_get_parent (scrolled);
browser->inspector_view = gtk_viewport_new (NULL, NULL); browser->inspector_view = gtk_viewport_new (NULL, NULL);
gtk_container_remove (GTK_CONTAINER (scrolled), GTK_WIDGET (inspector_view)); gtk_container_remove (GTK_CONTAINER (scrolled), GTK_WIDGET (inspector_view));
gtk_container_add (GTK_CONTAINER (scrolled), browser->inspector_view); gtk_container_add (GTK_CONTAINER (scrolled), browser->inspector_view);
gtk_widget_hide (paned);
} }
static void static void

View file

@ -3736,7 +3736,7 @@ midori_view_web_inspector_close_window_cb (gpointer inspector,
GtkWidget* scrolled = gtk_widget_get_parent (GTK_WIDGET (inspector_view)); GtkWidget* scrolled = gtk_widget_get_parent (GTK_WIDGET (inspector_view));
if (!scrolled) if (!scrolled)
return FALSE; return FALSE;
gtk_widget_destroy (gtk_widget_get_parent (scrolled)); gtk_widget_hide (gtk_widget_get_parent (scrolled));
return TRUE; return TRUE;
} }