From ed4b63cbc6e677fa8d1be009985d175212f60af3 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Sat, 6 May 2017 01:55:27 +0200
Subject: [PATCH] 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.
---
 src/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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);
+    }
 }
 
 /**
-- 
2.20.1