From 36fde6dbe1d1cfa1a285351dbdefd99961ecdc8c Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 24 Jul 2011 14:47:28 +0200 Subject: [PATCH] ipc: send 'percent': null when percent is not relevant for the container --- src/ipc.c | 4 +++- testcases/t/16-nestedcons.t | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ipc.c b/src/ipc.c index acd09e8f..a5e4a66c 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -193,7 +193,9 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) { } ystr("percent"); - y(double, con->percent); + if (con->percent == 0.0) + y(null); + else y(double, con->percent); ystr("urgent"); y(integer, con->urgent); diff --git a/testcases/t/16-nestedcons.t b/testcases/t/16-nestedcons.t index 8d25482b..72526f08 100644 --- a/testcases/t/16-nestedcons.t +++ b/testcases/t/16-nestedcons.t @@ -25,7 +25,7 @@ my $expected = { window_rect => ignore(), geometry => ignore(), swallows => ignore(), - percent => 0, + percent => undef, layout => 'default', focus => ignore(), focused => 0,