From 9ced8fc3981ad0dc9dba24fe414df71292420dba Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 14 Nov 2010 06:03:59 -0700 Subject: fix the status bar in uzbl-tabbed --- src/uzbl-core.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 1bac5ed..fb7b641 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1854,26 +1854,27 @@ void update_title (void) { Behaviour *b = &uzbl.behave; gchar *parsed; + const gchar *current_title; + /* this check is here because if we're starting up or shutting down it might not be a window */ + gboolean have_main_window = !uzbl.state.plug_mode && GTK_IS_WINDOW(uzbl.gui.main_window); - if(!GTK_IS_WINDOW(uzbl.gui.main_window)) - return; /* we're just starting up or just shutting down. */ - - const gchar *current_title = gtk_window_get_title (GTK_WINDOW(uzbl.gui.main_window)); + if(have_main_window) + current_title = gtk_window_get_title (GTK_WINDOW(uzbl.gui.main_window)); if (b->show_status) { - if (b->title_format_short && uzbl.gui.main_window) { + if (b->title_format_short && have_main_window) { parsed = expand(b->title_format_short, 0); if(!current_title || strcmp(current_title, parsed)) gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed); g_free(parsed); } - if (b->status_format) { + if (b->status_format && GTK_IS_LABEL(uzbl.gui.mainbar_label)) { parsed = expand(b->status_format, 0); gtk_label_set_markup(GTK_LABEL(uzbl.gui.mainbar_label), parsed); g_free(parsed); } } else { - if (b->title_format_long && uzbl.gui.main_window) { + if (b->title_format_long && have_main_window) { parsed = expand(b->title_format_long, 0); if(!current_title || strcmp(current_title, parsed)) gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed); -- cgit v1.2.3