From 1b7401e2d19d39e8f56efc417549c4fd3737fbb8 Mon Sep 17 00:00:00 2001 From: Raphael Graf Date: Wed, 4 May 2011 20:11:37 +0000 Subject: show correct window titles when tabs are closed or reordered. ok marco@ --- xxxterm.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 " @@ -7486,6 +7488,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) { @@ -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); -- cgit 1.4.1-2-gfad0