X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=d107c470854d73f27d94436b5a6da80f6c1f92d2;hb=83a0303dd75ef0487fdd53e810914f21fdd3e459;hp=05a7b8916f042eb5110772a735326a2054dc610e;hpb=2f4cd02a69b5fb71f011b0cc0a3a054dda1a175f;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 05a7b891..d107c470 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1550,27 +1550,29 @@ void client_update_title(ObClient *self) 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 = g_list_next(it)) - if (it->data != self) { - ObClient *c = it->data; - if (0 == strncmp(c->title, data, strlen(data))) - nums |= 1 << c->title_count; - } - /* find first free number */ - for (i = 1; i <= 32; ++i) - if (!(nums & (1 << i))) { - if (self->title_count == 1 || i == 1) - self->title_count = i; - break; + if (config_title_number) { + /* look for duplicates and append a number */ + nums = 0; + 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))) + nums |= 1 << c->title_count; + } + /* find first free number */ + for (i = 1; i <= 32; ++i) + if (!(nums & (1 << i))) { + if (self->title_count == 1 || i == 1) + self->title_count = i; + break; + } + /* dont display the number for the first window */ + if (self->title_count > 1) { + gchar *ndata; + ndata = g_strdup_printf("%s - [%u]", data, self->title_count); + g_free(data); + data = ndata; } - /* dont display the number for the first window */ - if (self->title_count > 1) { - gchar *ndata; - ndata = g_strdup_printf("%s - [%u]", data, self->title_count); - g_free(data); - data = ndata; } no_number: @@ -1596,7 +1598,9 @@ no_number: read_title = FALSE; } - /* append the title count, dont display the number for the first window */ + /* append the title count, dont display the number for the first window. + * We don't need to check for config_title_number here since title_count + * is not set above 1 then. */ if (read_title && self->title_count > 1) { gchar *vdata, *ndata; ndata = g_strdup_printf(" - [%u]", self->title_count);