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,