ipc: send 'percent': null when percent is not relevant for the container

This commit is contained in:
Michael Stapelberg 2011-07-24 14:47:28 +02:00
parent f0aa52f674
commit 36fde6dbe1
2 changed files with 4 additions and 2 deletions

View File

@ -193,7 +193,9 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
} }
ystr("percent"); ystr("percent");
y(double, con->percent); if (con->percent == 0.0)
y(null);
else y(double, con->percent);
ystr("urgent"); ystr("urgent");
y(integer, con->urgent); y(integer, con->urgent);

View File

@ -25,7 +25,7 @@ my $expected = {
window_rect => ignore(), window_rect => ignore(),
geometry => ignore(), geometry => ignore(),
swallows => ignore(), swallows => ignore(),
percent => 0, percent => undef,
layout => 'default', layout => 'default',
focus => ignore(), focus => ignore(),
focused => 0, focused => 0,