From 78923c405a2634b77d0c59c06c3240444460cab7 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Mon, 28 May 2012 12:53:25 -0400 Subject: added a few more fixes - thanks Wouter Van Rooy --- svte.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/svte.c b/svte.c index 79311f2..20d059f 100644 --- a/svte.c +++ b/svte.c @@ -51,6 +51,7 @@ static void tab_new(); 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 GQuark term_data_id = 0; @@ -241,10 +242,7 @@ static void tab_title(GtkWidget *widget, term *t) { } -static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, - guint page_num, gpointer user_data) { - struct term *t; - t = get_page_term(NULL, page_num); +static void set_window_title(guint page_num, term *t){ const char *title = vte_terminal_get_window_title(VTE_TERMINAL(t->vte)); if (title == NULL) { title = "svte"; @@ -253,6 +251,14 @@ static void tab_focus(GtkNotebook *notebook, GtkNotebookPage *page, } +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); +} + + static void tab_new() { term *t; int *tmp; @@ -261,7 +267,7 @@ static void tab_new() { char **args = 0; const gchar *shell = g_getenv("SHELL"); if (!shell) { - shell = "/bin/sh"; + shell = "sh"; } g_shell_parse_argv(shell, 0, &args, 0); @@ -320,9 +326,7 @@ static void tab_new() { vte_terminal_match_set_cursor_type(VTE_TERMINAL(t->vte), *tmp, GDK_HAND2); g_free(tmp); - - gtk_window_set_title(GTK_WINDOW(svte.win), - vte_terminal_get_window_title(VTE_TERMINAL(t->vte))); + set_window_title(index, t); gtk_widget_show_all(svte.notebook); gtk_notebook_set_current_page(GTK_NOTEBOOK(svte.notebook), index); gtk_widget_grab_focus(t->vte); -- cgit v1.2.3