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 :).
*/
#include "all.h"
-char *colors[] = {
- "#ff0000",
- "#00FF00",
- "#0000FF",
- "#ff00ff",
- "#00ffff",
- "#ffff00",
- "#aa0000",
- "#00aa00",
- "#0000aa",
- "#aa00aa"};
-
static void con_on_remove_child(Con *con);
/*
new->depth = window->depth;
else
new->depth = XCB_COPY_FROM_PARENT;
- static int cnt = 0;
- DLOG("opening window %d\n", cnt);
-
- /* TODO: remove window coloring after test-phase */
- DLOG("color %s\n", colors[cnt]);
- new->name = strdup(colors[cnt]);
- //uint32_t cp = get_colorpixel(colors[cnt]);
- cnt++;
- if ((cnt % (sizeof(colors) / sizeof(char *))) == 0)
- cnt = 0;
+ DLOG("opening window\n");
TAILQ_INIT(&(new->floating_head));
TAILQ_INIT(&(new->nodes_head));
ystr("name");
if (con->window && con->window->name)
ystr(i3string_as_utf8(con->window->name));
- else
+ else if (con->name != NULL)
ystr(con->name);
+ else
+ y(null);
if (con->type == CT_WORKSPACE) {
ystr("num");
* 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");
/* Set the same name as was stored in the layout file. While perhaps
* slightly confusing in the first instant, this brings additional
* clarity to which placeholder is waiting for which actual window. */
- xcb_change_property(restore_conn, XCB_PROP_MODE_REPLACE, placeholder,
- A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(con->name), con->name);
+ if (con->name != NULL)
+ xcb_change_property(restore_conn, XCB_PROP_MODE_REPLACE, placeholder,
+ A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(con->name), con->name);
DLOG("Created placeholder window 0x%08x for leaf container %p / %s\n",
placeholder, con, con->name);
is(@{$first->{nodes}}, 0, 'first container has no children');
is(@{$second->{nodes}}, 0, 'second container has no children (yet)');
- my $old_name = $second->{name};
+ my $old_id = $second->{id};
cmd $args{split_command};
cmd 'open';
$second = $content->[1];
is(@{$first->{nodes}}, 0, 'first container has no children');
- isnt($second->{name}, $old_name, 'second container was replaced');
+ isnt($second->{id}, $old_id, 'second container was replaced');
is($second->{layout}, 'splith', 'orientation is horizontal');
is(@{$second->{nodes}}, 2, 'second container has 2 children');
- is($second->{nodes}->[0]->{name}, $old_name, 'found old second container');
+ is($second->{nodes}->[0]->{id}, $old_id, 'found old second container');
}
verify_split_layout(split_command => 'split h');