aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Bürk <admin@airblader.de>2020-03-09 13:01:11 +0100
committerGitHub <noreply@github.com>2020-03-09 13:01:11 +0100
commit164336099d731456448fd1150c3993f08c82dcc4 (patch)
tree5a51c41a6901c6d630db8891913f6bf26b649b23
parentcae3b294ad2f94f709cf0f7f57b7be50e9de4b88 (diff)
parentd02cda4241dc822096bada51ae5fc4c1d28485a3 (diff)
downloadi3-164336099d731456448fd1150c3993f08c82dcc4.tar.gz
i3-164336099d731456448fd1150c3993f08c82dcc4.zip
Merge pull request #3970 from ianyfan/ipc
ipc: always include marks property in TREE reply
-rw-r--r--src/ipc.c16
-rw-r--r--testcases/t/116-nestedcons.t1
-rw-r--r--testcases/t/210-mark-unmark.t10
3 files changed, 12 insertions, 15 deletions
diff --git a/src/ipc.c b/src/ipc.c
index 08bdde33..100e1f70 100644
--- a/src/ipc.c
+++ b/src/ipc.c
@@ -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));
diff --git a/testcases/t/116-nestedcons.t b/testcases/t/116-nestedcons.t
index 4f13b1e5..6a2274d4 100644
--- a/testcases/t/116-nestedcons.t
+++ b/testcases/t/116-nestedcons.t
@@ -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
diff --git a/testcases/t/210-mark-unmark.t b/testcases/t/210-mark-unmark.t
index 32f898e6..0d9a073b 100644
--- a/testcases/t/210-mark-unmark.t
+++ b/testcases/t/210-mark-unmark.t
@@ -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');
##############################################################