diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-05-12 09:01:16 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-05-12 09:01:16 -0400 |
commit | 2da685e913432716f55cd537fd3d64f3fb3cc09a (patch) | |
tree | c986cca12ecdb3e3ac4d94d38205028788315889 /sway/ipc-server.c | |
parent | Merge branch 'master' into scdoc (diff) | |
parent | Merge pull request #1959 from RyanDwyer/ipc-get-seats (diff) | |
download | sway-2da685e913432716f55cd537fd3d64f3fb3cc09a.tar.gz sway-2da685e913432716f55cd537fd3d64f3fb3cc09a.tar.zst sway-2da685e913432716f55cd537fd3d64f3fb3cc09a.zip |
Merge remote-tracking branch 'origin/master' into scdoc
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 39d1d0a7..8734e8f8 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -546,6 +546,19 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
546 | goto exit_cleanup; | 546 | goto exit_cleanup; |
547 | } | 547 | } |
548 | 548 | ||
549 | case IPC_GET_SEATS: | ||
550 | { | ||
551 | json_object *seats = json_object_new_array(); | ||
552 | struct sway_seat *seat = NULL; | ||
553 | wl_list_for_each(seat, &input_manager->seats, link) { | ||
554 | json_object_array_add(seats, ipc_json_describe_seat(seat)); | ||
555 | } | ||
556 | const char *json_string = json_object_to_json_string(seats); | ||
557 | ipc_send_reply(client, json_string, (uint32_t)strlen(json_string)); | ||
558 | json_object_put(seats); // free | ||
559 | goto exit_cleanup; | ||
560 | } | ||
561 | |||
549 | case IPC_GET_TREE: | 562 | case IPC_GET_TREE: |
550 | { | 563 | { |
551 | json_object *tree = | 564 | json_object *tree = |