summaryrefslogtreecommitdiff
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorTony Crisci <[email protected]>2017-12-18 11:01:11 -0500
committerTony Crisci <[email protected]>2017-12-18 11:01:11 -0500
commita949d7de5a7df2a3eaf51f4993ea94cf0dbc4a9a (patch)
tree2278e3db6ca185c2f4789c65f4b42e96a44e3664 /sway/ipc-server.c
parenta87960711a9587ed2f484c2ba8a5cb9e18d1d641 (diff)
parenteb4f66f7857d3e7cd8ac14a7fb43502fbc70de98 (diff)
Merge branch 'wlroots' into feature/input
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 71f8dddd..b7cd2d76 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -343,6 +343,22 @@ void ipc_client_handle_command(struct ipc_client *client) {
goto exit_cleanup;
}
+ case IPC_GET_OUTPUTS:
+ {
+ json_object *outputs = json_object_new_array();
+ for (int i = 0; i < root_container.children->length; ++i) {
+ swayc_t *container = root_container.children->items[i];
+ if (container->type == C_OUTPUT) {
+ json_object_array_add(outputs,
+ ipc_json_describe_container(container));
+ }
+ }
+ const char *json_string = json_object_to_json_string(outputs);
+ ipc_send_reply(client, json_string, (uint32_t) strlen(json_string));
+ json_object_put(outputs); // free
+ goto exit_cleanup;
+ }
+
case IPC_GET_TREE:
{
json_object *tree =