summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-08 17:51:54 +0000
committerDana Jansens <danakj@orodu.net>2003-09-08 17:51:54 +0000
commit9f2a844beb62287e12e75bf207e4c55bc14b6209 (patch)
treeb53d09291f0b2ea9703383bd2072ee1e929bddec /openbox
parente9d878f47dfd70e495754459dbef24c37ea96de1 (diff)
watch for windows with titlecounts changing their title and getting an incorrect titlecount
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/openbox/client.c b/openbox/client.c
index c5934ded..fe23f05d 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -1308,10 +1308,11 @@ void client_update_title(ObClient *self)
GList *it;
guint32 nums;
guint i;
- char *data = NULL;
+ gchar *data = NULL;
gboolean read_title;
+ gchar *old_title;
- g_free(self->title);
+ old_title = self->title;
/* try netwm */
if (!PROP_GETS(self->window, net_wm_name, utf8, &data))
@@ -1319,6 +1320,10 @@ void client_update_title(ObClient *self)
if (!PROP_GETS(self->window, wm_name, locale, &data))
data = g_strdup("Unnamed Window");
+ /* did the title change? then reset the title_count */
+ if (old_title && 0 != strncmp(old_title, data, strlen(data)))
+ self->title_count = 1;
+
/* look for duplicates and append a number */
nums = 0;
for (it = client_list; it; it = it->next)
@@ -1349,6 +1354,8 @@ void client_update_title(ObClient *self)
if (self->frame)
frame_adjust_title(self->frame);
+ g_free(old_title);
+
/* update the icon title */
data = NULL;
g_free(self->icon_title);