summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Lohmann <20h@r-36.net>2014-02-05 21:14:16 +0100
committerChristoph Lohmann <20h@r-36.net>2014-02-05 21:14:16 +0100
commit361da0b3c4bc9f86d4653b026ad16ec4ed5c02c2 (patch)
tree44b627686871665c2ede077b64e7d79f7dcfcd55
parentb7435badc2558dfd9b177005a0884b9bbc12fa1e (diff)
downloadsurf-361da0b3c4bc9f86d4653b026ad16ec4ed5c02c2.tar.gz
surf-361da0b3c4bc9f86d4653b026ad16ec4ed5c02c2.tar.bz2
surf-361da0b3c4bc9f86d4653b026ad16ec4ed5c02c2.zip
Making the empty title possible.
-rw-r--r--surf.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/surf.c b/surf.c
index 0298ed3..c598404 100644
--- a/surf.c
+++ b/surf.c
@@ -707,6 +707,9 @@ newclient(void) {
if(!(c = calloc(1, sizeof(Client))))
die("Cannot malloc!\n");
+ c->title = NULL;
+ c->progress = 100;
+
/* Window */
if(embed) {
c->win = gtk_plug_new(embed);
@@ -890,9 +893,6 @@ newclient(void) {
if(hidebackground)
webkit_web_view_set_transparent(c->view, TRUE);
- c->title = "";
- c->progress = 100;
- updatetitle(c);
c->next = clients;
clients = c;
@@ -1337,16 +1337,18 @@ updatetitle(Client *c) {
pagestat, c->linkhover);
} else if(c->progress != 100) {
t = g_strdup_printf("[%i%%] %s:%s | %s", c->progress,
- togglestat, pagestat, c->title);
+ togglestat, pagestat,
+ (c->title == NULL)? "" : c->title);
} else {
t = g_strdup_printf("%s:%s | %s", togglestat, pagestat,
- c->title);
+ (c->title == NULL)? "" : c->title);
}
gtk_window_set_title(GTK_WINDOW(c->win), t);
g_free(t);
} else {
- gtk_window_set_title(GTK_WINDOW(c->win), c->title);
+ gtk_window_set_title(GTK_WINDOW(c->win),
+ (c->title == NULL)? "" : c->title);
}
}
@@ -1390,6 +1392,7 @@ zoom(Client *c, const Arg *arg) {
int
main(int argc, char *argv[]) {
Arg arg;
+ Client *c;
memset(&arg, 0, sizeof(arg));
@@ -1462,7 +1465,7 @@ main(int argc, char *argv[]) {
useragent = EARGF(usage());
break;
case 'v':
- die("surf-"VERSION", ©2009-2012 surf engineers, "
+ die("surf-"VERSION", ©2009-2014 surf engineers, "
"see LICENSE for details\n");
case 'x':
showxid = TRUE;
@@ -1477,9 +1480,12 @@ main(int argc, char *argv[]) {
arg.v = argv[0];
setup();
- newclient();
- if(arg.v)
+ c = newclient();
+ if(arg.v) {
loaduri(clients, &arg);
+ } else {
+ updatetitle(c);
+ }
gtk_main();
cleanup();