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);
if(hidebackground)
webkit_web_view_set_transparent(c->view, TRUE);
- c->title = "";
- c->progress = 100;
- updatetitle(c);
c->next = clients;
clients = 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);
}
}
int
main(int argc, char *argv[]) {
Arg arg;
+ Client *c;
memset(&arg, 0, sizeof(arg));
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;
arg.v = argv[0];
setup();
- newclient();
- if(arg.v)
+ c = newclient();
+ if(arg.v) {
loaduri(clients, &arg);
+ } else {
+ updatetitle(c);
+ }
gtk_main();
cleanup();