diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/ephy-notebook.c | 19 | ||||
-rw-r--r-- | src/ephy-window.c | 1 |
3 files changed, 15 insertions, 13 deletions
@@ -1,5 +1,13 @@ 2004-10-25 Christian Persch <chpe@cvs.gnome.org> + * src/ephy-notebook.c: (ephy_notebook_remove_tab): + * src/ephy-window.c: (ephy_window_get_active_tab): + + Move window destruction after tab-removed signal emission. + Fixes bug #151607. + +2004-10-25 Christian Persch <chpe@cvs.gnome.org> + * src/ephy-notebook.h: Fix return type of tab_delete slot. 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; } |