]> git.sur5r.net Git - i3/i3/commitdiff
ipc: send 'percent': null when percent is not relevant for the container
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 24 Jul 2011 12:47:28 +0000 (14:47 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 24 Jul 2011 12:47:28 +0000 (14:47 +0200)
src/ipc.c
testcases/t/16-nestedcons.t

index acd09e8fb185c7c1cbbe3a1bda713392e5983c01..a5e4a66c8b9139318475116d6db47d4a8a6fb56f 100644 (file)
--- 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);
index 8d25482b5630ae735fd004410492b35ddf39ba0c..72526f088e1374526ca937447b9ddcabc688afe5 100644 (file)
@@ -25,7 +25,7 @@ my $expected = {
     window_rect => ignore(),
     geometry => ignore(),
     swallows => ignore(),
-    percent => 0,
+    percent => undef,
     layout => 'default',
     focus => ignore(),
     focused => 0,