]> git.armaanb.net Git - chorizo.git/commitdiff
Don't set empty string as window title
authorPeter Hofmann <scm@uninformativ.de>
Mon, 4 Jan 2016 19:29:15 +0000 (20:29 +0100)
committerPeter Hofmann <scm@uninformativ.de>
Mon, 4 Jan 2016 19:29:15 +0000 (20:29 +0100)
CHANGES
browser.c

diff --git a/CHANGES b/CHANGES
index ad41c1aacdf4396ead3548111a8db6aa1b217057..1ab01ba4315582603748ee8e6de977eaaaf73d89 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ next
     loading the URL" or "begin searching for search term".
   - Issue #15: lariza no longer tries to create local file names with
     directory separators in them when downloading files.
+  - lariza no longer sets the window title to an empty string.
 
   [Changed]
   - For the sake of consistency, $LARIZA_WEB_EXTENSIONS_DIR has been
index 40aff75c6006f562ca268974c912c7d225e6da6c..ac38cac1cda89d783bf2ca2a665d7fc87889a50d 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -321,11 +321,19 @@ changed_load_progress(GObject *obj, GParamSpec *pspec, gpointer data)
 void
 changed_title(GObject *obj, GParamSpec *pspec, gpointer data)
 {
-    const gchar *t;
+    const gchar *t, *u;
     struct Client *c = (struct Client *)data;
 
+    u = webkit_web_view_get_uri(WEBKIT_WEB_VIEW(c->web_view));
     t = webkit_web_view_get_title(WEBKIT_WEB_VIEW(c->web_view));
-    gtk_window_set_title(GTK_WINDOW(c->win), (t == NULL ? __NAME__ : t));
+
+    u = u == NULL ? __NAME__ : u;
+    u = u[0] == 0 ? __NAME__ : u;
+
+    t = t == NULL ? u : t;
+    t = t[0] == 0 ? u : t;
+
+    gtk_window_set_title(GTK_WINDOW(c->win), t);
 }
 
 void