summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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