Don't set empty title is none is found.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 5 May 2017 23:55:27 +0000 (01:55 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 5 May 2017 23:55:27 +0000 (01:55 +0200)
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.

src/main.c

index 8a13d57..6d3188f 100644 (file)
@@ -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);
+    }
 }
 
 /**