From 00a7c05a23487f4baa3969b8b507d8fcbc9fe978 Mon Sep 17 00:00:00 2001 From: Wouter Van Rooy Date: Fri, 15 Jun 2012 21:33:03 +0200 Subject: Removed unused page_num variable in set_window_title function Fix the setting of the window title on window-title-changed signal --- svte.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'svte.c') diff --git a/svte.c b/svte.c index ad10d43..623d602 100644 --- a/svte.c +++ b/svte.c @@ -53,7 +53,7 @@ static void tab_togglebar(); static void configure_window(); static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data); -static void set_window_title(guint page_num, term *t); +static void set_window_title(term *t); static void copy_clipboard(); static void paste_clipboard(); @@ -279,13 +279,11 @@ static void tab_geometry_hints(term *t) { static void tab_title(GtkWidget *widget, term *t) { - gtk_label_set_text( - GTK_LABEL(t->label), - vte_terminal_get_window_title(VTE_TERMINAL(t->vte))); -} + set_window_title(t); +} -static void set_window_title(guint page_num, term *t){ +static void set_window_title(term *t){ const char *title = vte_terminal_get_window_title(VTE_TERMINAL(t->vte)); if (title == NULL) { title = "svte"; @@ -293,12 +291,11 @@ static void set_window_title(guint page_num, term *t){ gtk_window_set_title(GTK_WINDOW(svte.win), title); } - static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data) { struct term *t; t = get_page_term(NULL, page_num); - set_window_title(page_num, t); + set_window_title(t); } @@ -370,7 +367,7 @@ static void tab_new() { vte_terminal_match_set_cursor_type(VTE_TERMINAL(t->vte), *tmp, GDK_HAND2); g_free(tmp); - set_window_title(index, t); + set_window_title(t); gtk_widget_show_all(svte.notebook); gtk_notebook_set_current_page(GTK_NOTEBOOK(svte.notebook), index); gtk_widget_grab_focus(t->vte); @@ -396,6 +393,9 @@ static void configure_window() { g_signal_connect(svte.win, "key-press-event", G_CALLBACK(event_key), NULL); g_signal_connect(G_OBJECT(svte.notebook), "switch-page", G_CALLBACK(tab_focus), NULL); + struct term *t; + t = get_page_term(NULL, 0); + set_window_title(t); } -- cgit v1.2.3