summaryrefslogtreecommitdiff
path: root/gtk/gtk_window.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2010-04-07 22:28:19 +0000
committerJames Bursa <james@netsurf-browser.org>2010-04-07 22:28:19 +0000
commit92bf8b1a7b0c105fc8c5d9c18aaade73effc07b0 (patch)
tree8ed19aec3a38671a388e1a2fb89688830a6c77e0 /gtk/gtk_window.c
parentfb8fdb4db1ea5bcadf098789611529c0dbccb2c2 (diff)
downloadnetsurf-92bf8b1a7b0c105fc8c5d9c18aaade73effc07b0.tar.gz
netsurf-92bf8b1a7b0c105fc8c5d9c18aaade73effc07b0.tar.bz2
Partly fix tab closing.
svn path=/trunk/netsurf/; revision=10294
Diffstat (limited to 'gtk/gtk_window.c')
-rw-r--r--gtk/gtk_window.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c
index e586879f1..b756a6286 100644
--- a/gtk/gtk_window.c
+++ b/gtk/gtk_window.c
@@ -697,11 +697,15 @@ void gui_window_destroy(struct gui_window *g)
LOG((" Scaffolding: %p", g->scaffold));
LOG((" Window name: %s", g->bw->name));
- /* If we're a top-level gui_window, destroy our scaffold */
if (g->scrolledwindow == NULL) {
- gtk_widget_destroy(GTK_WIDGET(g->layout));
- nsgtk_scaffolding_destroy(g->scaffold);
+ /* tab => remove tab */
+ gtk_widget_destroy(gtk_widget_get_parent(GTK_WIDGET(g->layout)));
+ /* if it was the last tab, destroy scaffold too */
+ gint numbertabs = gtk_notebook_get_n_pages(nsgtk_scaffolding_notebook(g->scaffold));
+ if (numbertabs == 0)
+ nsgtk_scaffolding_destroy(g->scaffold);
} else {
+ /* frame within a document => destroy frame only */
gtk_widget_destroy(GTK_WIDGET(g->scrolledwindow));
}