aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-11 23:51:47 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-12 18:17:36 +1000
commitc72940837c24b5df99c95667befe2e4e5c64575a (patch)
treeeae77f45803c33f0825ee134956b9dac292a52b1 /sway/ipc-server.c
parentMerge pull request #1952 from Dudemanguy911/fix-crash-on-fullscreen (diff)
downloadsway-c72940837c24b5df99c95667befe2e4e5c64575a.tar.gz
sway-c72940837c24b5df99c95667befe2e4e5c64575a.tar.zst
sway-c72940837c24b5df99c95667befe2e4e5c64575a.zip
Implement IPC get_seats command
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r--sway/ipc-server.c13
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 =