logo

badwolf

minimalist and privacy-oriented web browser based on WebKitGTK git clone https://hacktivis.me/git/badwolf.git
commit: ff1145c68ce510edeb674e07183a1b6d7bae96d1
parent 1a7efbf367f2476f5214da011fefe290c0c06079
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat,  6 Apr 2019 03:27:35 +0200

badwolf.c: Change window title with the current tab

Diffstat:

Mbadwolf.c7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 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,