summaryrefslogtreecommitdiff
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2017-12-03 08:55:39 -0500
committerGitHub <[email protected]>2017-12-03 08:55:39 -0500
commitb6f4120afc85f0df301a6823b8d8bca08d367fda (patch)
tree51328ffc0f6ee28680e402128f6180de7454cc3d /sway/ipc-server.c
parent65f9508fc642a19200bfcad91864c21ac0a8d524 (diff)
parent421f49fe034cc8a48348ba57af8fdf3f98adb62c (diff)
Merge pull request #1489 from acrisci/feature/basic-get-tree
basic get_tree
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index f3a6469b..71f8dddd 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -343,6 +343,16 @@ void ipc_client_handle_command(struct ipc_client *client) {
goto exit_cleanup;
}
+ case IPC_GET_TREE:
+ {
+ json_object *tree =
+ ipc_json_describe_container_recursive(&root_container);
+ const char *json_string = json_object_to_json_string(tree);
+ ipc_send_reply(client, json_string, (uint32_t) strlen(json_string));
+ json_object_put(tree);
+ goto exit_cleanup;
+ }
+
case IPC_GET_VERSION:
{
json_object *version = ipc_json_get_version();