aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-25 21:54:25 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-25 21:54:25 +0800
commitda7d0959009b472233de886affce4ed9a81b2475 (patch)
tree85f69e5c5646b47cfad9f2134c50bdc4ac4ab55e /src
parent46d371aa12282b3d8cd8549acb0898071b0097fe (diff)
downloadgsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.tar
gsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.tar.gz
gsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.tar.bz2
gsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.tar.lz
gsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.tar.xz
gsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.tar.zst
gsoc2013-epiphany-da7d0959009b472233de886affce4ed9a81b2475.zip
Move window destruction after tab-removed signal emission. Fixes bug
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.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-notebook.c19
-rw-r--r--src/ephy-window.c1
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;
}