diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-07-08 20:32:42 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-07-10 12:03:46 +0100 |
commit | 5fd36164a008f931def993413facf9058c56641d (patch) | |
tree | 5714600f0fd8b8f1a2570cad4d7bc8ab48e7eb1e /sway/ipc-server.c | |
parent | Merge pull request #2236 from kupospelov/fix-stacked-layout (diff) | |
download | sway-5fd36164a008f931def993413facf9058c56641d.tar.gz sway-5fd36164a008f931def993413facf9058c56641d.tar.zst sway-5fd36164a008f931def993413facf9058c56641d.zip |
Add get_binding_modes message type to ipc
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 197851cf..70a4141e 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -667,6 +667,20 @@ void ipc_client_handle_command(struct ipc_client *client) { | |||
667 | goto exit_cleanup; | 667 | goto exit_cleanup; |
668 | } | 668 | } |
669 | 669 | ||
670 | case IPC_GET_BINDING_MODES: | ||
671 | { | ||
672 | json_object *modes = json_object_new_array(); | ||
673 | for (int i = 0; i < config->modes->length; i++) { | ||
674 | struct sway_mode *mode = config->modes->items[i]; | ||
675 | json_object_array_add(modes, json_object_new_string(mode->name)); | ||
676 | } | ||
677 | const char *json_string = json_object_to_json_string(modes); | ||
678 | client_valid = | ||
679 | ipc_send_reply(client, json_string, (uint32_t)strlen(json_string)); | ||
680 | json_object_put(modes); // free | ||
681 | goto exit_cleanup; | ||
682 | } | ||
683 | |||
670 | default: | 684 | default: |
671 | wlr_log(WLR_INFO, "Unknown IPC command type %i", client->current_command); | 685 | wlr_log(WLR_INFO, "Unknown IPC command type %i", client->current_command); |
672 | goto exit_cleanup; | 686 | goto exit_cleanup; |