diff options
badwolf.c: Change window title with the current tab
1 files changed, 6 insertions, 1 deletions
| -rw-r--r-- | badwolf.c | 7 |
@@ -172,6 +172,7 @@ WebViewCb_notify__is__playing__audio(WebKitWebView *webView, GParamSpec *pspec, void webView_tab_label_change(struct Client *browser) { const gchar *title; + GtkWidget *notebook = browser->window->notebook; title = webkit_web_view_get_title(browser->webView); @@ -180,7 +181,11 @@ void webView_tab_label_change(struct Client *browser) if(title == NULL) title = "BadWolf"; gtk_notebook_set_tab_label( - GTK_NOTEBOOK(browser->window->notebook), browser->box, badwolf_new_tab_box(title, browser)); + GTK_NOTEBOOK(notebook), browser->box, badwolf_new_tab_box(title, browser)); + + if(get_tab_position(GTK_CONTAINER(notebook), browser->box) == + gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))) + gtk_window_set_title(GTK_WINDOW(browser->window->main_window), title); } static gboolean WebViewCb_notify__estimated_load_progress(WebKitWebView *webView, |