From: Michael Stapelberg Date: Sun, 24 Jul 2011 12:47:28 +0000 (+0200) Subject: ipc: send 'percent': null when percent is not relevant for the container X-Git-Tag: 4.0~14^2~65 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=36fde6dbe1d1cfa1a285351dbdefd99961ecdc8c;p=i3%2Fi3 ipc: send 'percent': null when percent is not relevant for the container --- 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,