aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ephy-notebook.c6
-rw-r--r--src/ephy-window.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index b229fb4b3..686cfe932 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -800,10 +800,4 @@ ephy_notebook_remove (GtkContainer *container,
GTK_CONTAINER_CLASS (ephy_notebook_parent_class)->remove (container, tab_widget);
update_tabs_visibility (notebook, FALSE);
-
- /* if that was the last tab, destroy the window */
- if (gtk_notebook_get_n_pages (gnotebook) == 0)
- {
- gtk_widget_destroy (gtk_widget_get_toplevel (GTK_WIDGET (notebook)));
- }
}
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 0575f8ea3..7cfe703d7 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2730,6 +2730,13 @@ notebook_page_close_request_cb (EphyNotebook *notebook,
{
gtk_widget_destroy (GTK_WIDGET (embed));
}
+
+ /* If that was the last tab, destroy the window. */
+ if (gtk_notebook_get_n_pages (priv->notebook) == 0)
+ {
+ gtk_widget_destroy (GTK_WIDGET (window));
+ }
+
}
static GtkWidget *