summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2016-01-04 20:29:15 +0100
committerPeter Hofmann <scm@uninformativ.de>2016-01-04 20:29:15 +0100
commite7febe818cc19afb2028c7658a156ec460470162 (patch)
tree7418c5f33b6aa0dd67c494b4c8a6af9b7227e85c
parent13807022f8ec4844a6961ea1919238ca673d1124 (diff)
downloadlariza-e7febe818cc19afb2028c7658a156ec460470162.tar.gz
Don't set empty string as window title
-rw-r--r--CHANGES1
-rw-r--r--browser.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index ad41c1a..1ab01ba 100644
--- 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
diff --git a/browser.c b/browser.c
index 40aff75..ac38cac 100644
--- 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