summaryrefslogtreecommitdiff
path: root/surf.c
diff options
context:
space:
mode:
authorQuentin Rameau <quinq@fifth.space>2015-11-20 16:59:15 +0100
committerQuentin Rameau <quinq@fifth.space>2015-11-20 16:59:15 +0100
commite6cefa584e605b8a9984b1a542098df1191adcb1 (patch)
treed24a6883af74b1bf71d43cce9d45b4f950358655 /surf.c
parentb5096b1c8f0416395758ab033e87b249b09b7a36 (diff)
downloadsurf-e6cefa584e605b8a9984b1a542098df1191adcb1.tar.gz
surf-e6cefa584e605b8a9984b1a542098df1191adcb1.tar.bz2
surf-e6cefa584e605b8a9984b1a542098df1191adcb1.zip
Adapt updatetitle()
Now always show loading progress, still print mouse over link uri before page uri. Process simplyfied because we use const strings.
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/surf.c b/surf.c
index 16bde9c..16ec398 100644
--- a/surf.c
+++ b/surf.c
@@ -1414,29 +1414,27 @@ getpagestats(Client *c)
void
updatetitle(Client *c)
{
- char *t;
+ char *title;
if (showindicators) {
gettogglestats(c);
getpagestats(c);
- if (c->linkhover) {
- t = g_strdup_printf("%s:%s | %s", togglestats, pagestats,
- c->linkhover);
- } else if (c->progress != 100) {
- t = g_strdup_printf("[%i%%] %s:%s | %s", c->progress,
- togglestats, pagestats,
- c->title == NULL ? "" : c->title);
+ if (c->progress != 100) {
+ title = g_strdup_printf("[%i%%] %s:%s | %s",
+ c->progress, togglestats, pagestats,
+ c->targeturi ? c->targeturi : c->title);
} else {
- t = g_strdup_printf("%s:%s | %s", togglestats, pagestats,
- c->title == NULL ? "" : c->title);
+ title = g_strdup_printf("%s:%s | %s",
+ togglestats, pagestats,
+ c->targeturi ? c->targeturi : c->title);
}
- gtk_window_set_title(GTK_WINDOW(c->win), t);
- g_free(t);
+ gtk_window_set_title(GTK_WINDOW(c->win), title);
+ g_free(title);
} else {
- gtk_window_set_title(GTK_WINDOW(c->win), (c->title == NULL) ?
- "" : c->title);
+ gtk_window_set_title(GTK_WINDOW(c->win), c->title ?
+ c->title : "");
}
}