From ff1145c68ce510edeb674e07183a1b6d7bae96d1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 6 Apr 2019 03:27:35 +0200 Subject: badwolf.c: Change window title with the current tab --- badwolf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 4df0154..098f5c7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -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, -- cgit v1.3.1-23-gd82d