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:
parent
ee75821699
commit
0d656dd05d
23
src/con.c
23
src/con.c
|
@ -13,18 +13,6 @@
|
||||||
*/
|
*/
|
||||||
#include "all.h"
|
#include "all.h"
|
||||||
|
|
||||||
char *colors[] = {
|
|
||||||
"#ff0000",
|
|
||||||
"#00FF00",
|
|
||||||
"#0000FF",
|
|
||||||
"#ff00ff",
|
|
||||||
"#00ffff",
|
|
||||||
"#ffff00",
|
|
||||||
"#aa0000",
|
|
||||||
"#00aa00",
|
|
||||||
"#0000aa",
|
|
||||||
"#aa00aa"};
|
|
||||||
|
|
||||||
static void con_on_remove_child(Con *con);
|
static void con_on_remove_child(Con *con);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -59,16 +47,7 @@ Con *con_new_skeleton(Con *parent, i3Window *window) {
|
||||||
new->depth = window->depth;
|
new->depth = window->depth;
|
||||||
else
|
else
|
||||||
new->depth = XCB_COPY_FROM_PARENT;
|
new->depth = XCB_COPY_FROM_PARENT;
|
||||||
static int cnt = 0;
|
DLOG("opening window\n");
|
||||||
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;
|
|
||||||
|
|
||||||
TAILQ_INIT(&(new->floating_head));
|
TAILQ_INIT(&(new->floating_head));
|
||||||
TAILQ_INIT(&(new->nodes_head));
|
TAILQ_INIT(&(new->nodes_head));
|
||||||
|
|
|
@ -299,8 +299,10 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
|
||||||
ystr("name");
|
ystr("name");
|
||||||
if (con->window && con->window->name)
|
if (con->window && con->window->name)
|
||||||
ystr(i3string_as_utf8(con->window->name));
|
ystr(i3string_as_utf8(con->window->name));
|
||||||
else
|
else if (con->name != NULL)
|
||||||
ystr(con->name);
|
ystr(con->name);
|
||||||
|
else
|
||||||
|
y(null);
|
||||||
|
|
||||||
if (con->type == CT_WORKSPACE) {
|
if (con->type == CT_WORKSPACE) {
|
||||||
ystr("num");
|
ystr("num");
|
||||||
|
|
|
@ -98,26 +98,21 @@ static int json_end_map(void *ctx) {
|
||||||
* workspace called “1”. */
|
* workspace called “1”. */
|
||||||
Con *output;
|
Con *output;
|
||||||
Con *workspace = NULL;
|
Con *workspace = NULL;
|
||||||
TAILQ_FOREACH (output, &(croot->nodes_head), nodes)
|
TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
|
||||||
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
|
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
|
||||||
char *base = sstrdup(json_node->name);
|
char *base = sstrdup(json_node->name);
|
||||||
int cnt = 1;
|
int cnt = 1;
|
||||||
while (workspace != NULL) {
|
while (workspace != NULL) {
|
||||||
FREE(json_node->name);
|
FREE(json_node->name);
|
||||||
asprintf(&(json_node->name), "%s_%d", base, cnt++);
|
asprintf(&(json_node->name), "%s_%d", base, cnt++);
|
||||||
workspace = NULL;
|
workspace = NULL;
|
||||||
TAILQ_FOREACH (output, &(croot->nodes_head), nodes)
|
TAILQ_FOREACH(output, &(croot->nodes_head), nodes)
|
||||||
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
|
GREP_FIRST(workspace, output_get_content(output), !strcasecmp(child->name, json_node->name));
|
||||||
}
|
}
|
||||||
free(base);
|
free(base);
|
||||||
|
|
||||||
/* Set num accordingly so that i3bar will properly sort it. */
|
/* Set num accordingly so that i3bar will properly sort it. */
|
||||||
json_node->num = ws_name_to_number(json_node->name);
|
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");
|
LOG("attaching\n");
|
||||||
|
|
|
@ -197,8 +197,9 @@ static void open_placeholder_window(Con *con) {
|
||||||
/* Set the same name as was stored in the layout file. While perhaps
|
/* Set the same name as was stored in the layout file. While perhaps
|
||||||
* slightly confusing in the first instant, this brings additional
|
* slightly confusing in the first instant, this brings additional
|
||||||
* clarity to which placeholder is waiting for which actual window. */
|
* clarity to which placeholder is waiting for which actual window. */
|
||||||
xcb_change_property(restore_conn, XCB_PROP_MODE_REPLACE, placeholder,
|
if (con->name != NULL)
|
||||||
A__NET_WM_NAME, A_UTF8_STRING, 8, strlen(con->name), con->name);
|
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",
|
DLOG("Created placeholder window 0x%08x for leaf container %p / %s\n",
|
||||||
placeholder, con, con->name);
|
placeholder, con, con->name);
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ sub verify_split_layout {
|
||||||
|
|
||||||
is(@{$first->{nodes}}, 0, 'first container has no children');
|
is(@{$first->{nodes}}, 0, 'first container has no children');
|
||||||
is(@{$second->{nodes}}, 0, 'second container has no children (yet)');
|
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 $args{split_command};
|
||||||
cmd 'open';
|
cmd 'open';
|
||||||
|
@ -60,10 +60,10 @@ sub verify_split_layout {
|
||||||
$second = $content->[1];
|
$second = $content->[1];
|
||||||
|
|
||||||
is(@{$first->{nodes}}, 0, 'first container has no children');
|
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->{layout}, 'splith', 'orientation is horizontal');
|
||||||
is(@{$second->{nodes}}, 2, 'second container has 2 children');
|
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');
|
verify_split_layout(split_command => 'split h');
|
||||||
|
|
Loading…
Reference in New Issue