--- openbox.orig/openbox/client.c 2003-10-25 14:43:46.000000000 -0500 +++ openbox/openbox/client.c 2003-11-08 21:43:28.000000000 -0600 @@ -1440,8 +1440,15 @@ for (it = client_list; it; it = g_list_next(it)) if (it->data != self) { ObClient *c = it->data; - if (0 == strncmp(c->title, data, strlen(data))) + gchar *p, *title = g_strdup(c->title); + if ((p = g_strrstr(title, " - ["))) { + gint len = strlen(p); + if (len == 6 /* - [2] */ || len == 7 /* - [32] */) + *p = '\0'; + } + if (0 == strcmp(title, data)) nums |= 1 << c->title_count; + g_free(title); } /* find first free number */ for (i = 1; i <= 32; ++i) @@ -1482,12 +1489,10 @@ /* append the title count, dont display the number for the first window */ if (read_title && self->title_count > 1) { - gchar *vdata, *ndata; - ndata = g_strdup_printf(" - [%u]", self->title_count); - vdata = g_strconcat(data, ndata, NULL); - g_free(ndata); + gchar *ndata; + ndata = g_strdup_printf("%s - [%u]", data, self->title_count); g_free(data); - data = vdata; + data = ndata; } PROP_SETS(self->window, net_wm_visible_icon_name, data);