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 :).
next
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

@ -13,18 +13,6 @@
*/
#include "all.h"
char *colors[] = {
"#ff0000",
"#00FF00",
"#0000FF",
"#ff00ff",
"#00ffff",
"#ffff00",
"#aa0000",
"#00aa00",
"#0000aa",
"#aa00aa"};
static void con_on_remove_child(Con *con);
/*
@ -59,16 +47,7 @@ Con *con_new_skeleton(Con *parent, i3Window *window) {
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));

View File

@ -299,8 +299,10 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
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");

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");

View File

@ -197,8 +197,9 @@ static void open_placeholder_window(Con *con) {
/* 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);

View File

@ -48,7 +48,7 @@ sub verify_split_layout {
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';
@ -60,10 +60,10 @@ sub verify_split_layout {
$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');