don’t set names corresponding to debug colors, remove “sleep 1”.

The names were (mostly) internal to i3 anyway.

Hopefully this doesn’t break anything, but I really think this old
behavior needs to go now :).
This commit is contained in:
Michael Stapelberg
2014-07-15 10:35:52 +02:00
parent ee75821699
commit 0d656dd05d
5 changed files with 14 additions and 37 deletions

View File

@ -98,26 +98,21 @@ static int json_end_map(void *ctx) {
* workspace called “1”. */
Con *output;
Con *workspace = NULL;
TAILQ_FOREACH (output, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
char *base = sstrdup(json_node->name);
int cnt = 1;
while (workspace != NULL) {
FREE(json_node->name);
asprintf(&(json_node->name), "%s_%d", base, cnt++);
workspace = NULL;
TAILQ_FOREACH (output, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
}
free(base);
/* Set num accordingly so that i3bar will properly sort it. */
json_node->num = ws_name_to_number(json_node->name);
} else {
// TODO: remove this in the “next” branch.
if (json_node->name == NULL || strcmp(json_node->name, "") == 0) {
json_node->name = sstrdup("#ff0000");
}
}
LOG("attaching\n");