about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorRaphael Graf <r@undefined.ch>2011-05-04 20:11:37 +0000
committerRaphael Graf <r@undefined.ch>2011-05-04 20:11:37 +0000
commit1b7401e2d19d39e8f56efc417549c4fd3737fbb8 (patch)
tree0b943e115e8751287c01947d850a31dc2aa543f1
parenta03b4d834f9e1e2de28bc769ac847d957c6f437d (diff)
downloadxombrero-1b7401e2d19d39e8f56efc417549c4fd3737fbb8.tar.gz
show correct window titles when tabs are closed or reordered.
ok marco@
-rw-r--r--xxxterm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/xxxterm.c b/xxxterm.c
index dcf4e2a..69fc1ef 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -7195,7 +7195,6 @@ delete_tab(struct tab *t)
 	g_free(t->stylesheet);
 	g_free(t);
 
-	recalc_tabs();
 	if (TAILQ_EMPTY(&tabs)) {
 		if (browser_mode == XT_BM_KIOSK)
 			create_new_tab(home, NULL, 1);
@@ -7467,6 +7466,9 @@ notebook_switchpage_cb(GtkNotebook *nb, GtkNotebookPage *nbp, guint pn,
 
 	DNPRINTF(XT_D_TAB, "notebook_switchpage_cb: tab: %d\n", pn);
 
+	if (gtk_notebook_get_current_page(notebook) == -1)
+		recalc_tabs();
+
 	TAILQ_FOREACH(t, &tabs, entry) {
 		if (t->tab_id == pn) {
 			DNPRINTF(XT_D_TAB, "notebook_switchpage_cb: going to "
@@ -7487,6 +7489,13 @@ notebook_switchpage_cb(GtkNotebook *nb, GtkNotebookPage *nbp, guint pn,
 }
 
 void
+notebook_pagereordered_cb(GtkNotebook *nb, GtkNotebookPage *nbp, guint pn,
+    gpointer *udata)
+{
+	recalc_tabs();
+}
+
+void
 menuitem_response(struct tab *t)
 {
 	gtk_notebook_set_current_page(notebook, t->tab_id);
@@ -7618,6 +7627,9 @@ create_canvas(void)
 	g_object_connect(G_OBJECT(notebook),
 	    "signal::switch-page", G_CALLBACK(notebook_switchpage_cb), NULL,
 	    (char *)NULL);
+	g_object_connect(G_OBJECT(notebook),
+	    "signal::page-reordered", G_CALLBACK(notebook_pagereordered_cb), NULL,
+	    (char *)NULL);
 	g_signal_connect(G_OBJECT(abtn), "button_press_event",
 	    G_CALLBACK(arrow_cb), NULL);