Merge pull request #3970 from ianyfan/ipc

ipc: always include marks property in TREE reply
This commit is contained in:
Ingo Bürk 2020-03-09 13:01:11 +01:00 committed by GitHub
commit 164336099d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 15 deletions

View File

@ -410,17 +410,13 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
ystr("urgent");
y(bool, con->urgent);
if (!TAILQ_EMPTY(&(con->marks_head))) {
ystr("marks");
y(array_open);
mark_t *mark;
TAILQ_FOREACH (mark, &(con->marks_head), marks) {
ystr(mark->name);
}
y(array_close);
ystr("marks");
y(array_open);
mark_t *mark;
TAILQ_FOREACH (mark, &(con->marks_head), marks) {
ystr(mark->name);
}
y(array_close);
ystr("focused");
y(bool, (con == focused));

View File

@ -72,6 +72,7 @@ my $expected = {
'floating_nodes' => $ignore,
workspace_layout => 'default',
current_border_width => -1,
marks => $ignore,
};
# a shallow copy is sufficient, since we only ignore values at the root

View File

@ -98,7 +98,7 @@ cmd 'focus left';
cmd 'mark important';
is_deeply(get_mark_for_window_on_workspace($tmp, $first), [ 'important' ], 'first container now has the mark');
ok(!get_mark_for_window_on_workspace($tmp, $second), 'second container lost the mark');
is_deeply(get_mark_for_window_on_workspace($tmp, $second), [], 'second container lost the mark');
##############################################################
# 5: mark a con, toggle the mark, check that the mark is gone
@ -107,7 +107,7 @@ ok(!get_mark_for_window_on_workspace($tmp, $second), 'second container lost the
$con = open_window;
cmd 'mark important';
cmd 'mark --toggle important';
ok(!get_mark_for_window_on_workspace($tmp, $con), 'container no longer has the mark');
is_deeply(get_mark_for_window_on_workspace($tmp, $con), [], 'container no longer has the mark');
##############################################################
# 6: toggle a mark on an unmarked con, check it is marked
@ -140,7 +140,7 @@ cmd 'focus left';
cmd 'mark --toggle important';
is_deeply(get_mark_for_window_on_workspace($tmp, $first), [ 'important' ], 'left container has the mark now');
ok(!get_mark_for_window_on_workspace($tmp, $second), 'second containr no longer has the mark');
is_deeply(get_mark_for_window_on_workspace($tmp, $second), [], 'second containr no longer has the mark');
##############################################################
# 9: try to mark two cons with the same mark and check that
@ -154,8 +154,8 @@ my $result = cmd "[instance=iamnotunique] mark important";
is($result->[0]->{success}, 0, 'command was unsuccessful');
is($result->[0]->{error}, 'A mark must not be put onto more than one window', 'correct error is returned');
ok(!get_mark_for_window_on_workspace($tmp, $first), 'first container is not marked');
ok(!get_mark_for_window_on_workspace($tmp, $second), 'second containr is not marked');
is_deeply(get_mark_for_window_on_workspace($tmp, $first), [], 'first container is not marked');
is_deeply(get_mark_for_window_on_workspace($tmp, $second), [], 'second containr is not marked');
##############################################################