aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2010-10-21 15:12:21 -0600
committerGravatar Brendan Taylor <whateley@gmail.com>2010-10-21 15:12:21 -0600
commit68ce1a4d1b5f9503ef89a798eb4936a7dd9ad9f8 (patch)
treec0575fea602d626e32cc983cfc6ed1522ffd185c /src
parent4f9d02dab352ad85877383d57e01ba3a6144c5b4 (diff)
only set the window title if it's actually changed.
fixes weird hangs in xmonad
Diffstat (limited to 'src')
-rw-r--r--src/uzbl-core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c
index 2d83f39..54975b9 100644
--- a/src/uzbl-core.c
+++ b/src/uzbl-core.c
@@ -1993,11 +1993,12 @@ void
update_title (void) {
Behaviour *b = &uzbl.behave;
gchar *parsed;
+ const gchar *current_title = gtk_window_get_title (GTK_WINDOW(uzbl.gui.main_window));
if (b->show_status) {
- if (b->title_format_short) {
+ if (b->title_format_short && uzbl.gui.main_window) {
parsed = expand(b->title_format_short, 0);
- if (uzbl.gui.main_window)
+ if(current_title && strcmp(current_title, parsed))
gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed);
g_free(parsed);
}
@@ -2007,9 +2008,9 @@ update_title (void) {
g_free(parsed);
}
} else {
- if (b->title_format_long) {
+ if (b->title_format_long && uzbl.gui.main_window) {
parsed = expand(b->title_format_long, 0);
- if (uzbl.gui.main_window)
+ if(current_title && strcmp(current_title, parsed))
gtk_window_set_title (GTK_WINDOW(uzbl.gui.main_window), parsed);
g_free(parsed);
}