diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-notebook.c | 19 | ||||
-rw-r--r-- | src/ephy-window.c | 1 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c index 3acde1c30..8c97d9228 100644 --- a/src/ephy-notebook.c +++ b/src/ephy-notebook.c @@ -1004,23 +1004,12 @@ void ephy_notebook_remove_tab (EphyNotebook *nb, EphyTab *tab) { - int num, position, curr; + int position, curr; GtkWidget *label, *ebox; g_return_if_fail (EPHY_IS_NOTEBOOK (nb)); g_return_if_fail (EPHY_IS_TAB (tab)); - num = gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)); - if (num <= 1) - { - GtkWidget *window; - window = gtk_widget_get_toplevel (GTK_WIDGET (nb)); - - g_signal_emit (G_OBJECT (nb), signals[TAB_REMOVED], 0, tab); - gtk_widget_destroy (window); - return; - } - /* Remove the page from the focused pages list */ nb->priv->focused_pages = g_list_remove (nb->priv->focused_pages, tab); @@ -1057,4 +1046,10 @@ ephy_notebook_remove_tab (EphyNotebook *nb, g_signal_emit (G_OBJECT (nb), signals[TAB_REMOVED], 0, tab); g_object_unref (tab); + + /* if that was the last tab, destroy the window */ + if (gtk_notebook_get_n_pages (GTK_NOTEBOOK (nb)) == 0) + { + gtk_widget_destroy (gtk_widget_get_toplevel (GTK_WIDGET (nb))); + } } diff --git a/src/ephy-window.c b/src/ephy-window.c index 4bf2f37e9..fd683a529 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2827,7 +2827,6 @@ EphyTab * ephy_window_get_active_tab (EphyWindow *window) { g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL); - g_return_val_if_fail (EPHY_IS_TAB (window->priv->active_tab), NULL); return window->priv->active_tab; } |