From: Daniel Carl Date: Fri, 5 May 2017 23:55:27 +0000 (+0200) Subject: Don't set empty title is none is found. X-Git-Url: https://git.owens.tech/projects.html/projects.html/git?a=commitdiff_plain;h=ed4b63cbc6e677fa8d1be009985d175212f60af3;p=vimb.git Don't set empty title is none is found. In case a page without a title or a none html file which can be shown is opened, webkit informed us about the title change to empty string. But no window title is no good idea, especial in case vimb runs within tabbed and there are multiple unnamed tabs. So we set the webview title only if it's not empty. --- diff --git a/src/main.c b/src/main.c index 8a13d57..6d3188f 100644 --- a/src/main.c +++ b/src/main.c @@ -1276,7 +1276,11 @@ static void on_webview_notify_estimated_load_progress(WebKitWebView *webview, */ static void on_webview_notify_title(WebKitWebView *webview, GParamSpec *pspec, Client *c) { - set_title(c, webkit_web_view_get_title(webview)); + const char *title = webkit_web_view_get_title(webview); + + if (*title) { + set_title(c, title); + } } /**