diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2022-07-26 13:20:56 +0530 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2022-07-26 13:20:56 +0530 |
| commit | d95644641a9b14d6372fec9ee759517f63ab1cfd (patch) | |
| tree | b483e0d7917dc11b36040b7b95543c5552f72c94 /swaymsg/main.c | |
| parent | 884478106da4b3baea6936d126522e20b25ab056 (diff) | |
swaymsg: fix floating_nodes being ignored
Fix floating_nodes being ignored in pretty_print_tree.
Diffstat (limited to 'swaymsg/main.c')
| -rw-r--r-- | swaymsg/main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c index 02bb12c6..c08406e2 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -331,6 +331,15 @@ static void pretty_print_tree(json_object *obj, int indent) { for (size_t i = 0; i < len; i++) { pretty_print_tree(json_object_array_get_idx(nodes_obj, i), indent + 1); } + + json_object *floating_nodes_obj; + json_bool floating_nodes = json_object_object_get_ex(obj, "floating_nodes", &floating_nodes_obj); + if (floating_nodes) { + size_t len = json_object_array_length(floating_nodes_obj); + for (size_t i = 0; i < len; i++) { + pretty_print_tree(json_object_array_get_idx(floating_nodes_obj, i), indent + 1); + } + } } static void pretty_print(int type, json_object *resp) { |
