diff options
author | Alex Maese <memaese@hotmail.com> | 2022-06-09 18:51:15 -0500 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-09-19 07:26:45 -0400 |
commit | 52f0e3a4d5bc5900df821b82a2c6941f57eaca25 (patch) | |
tree | 973d60e0f2d0d5ad7fe63aa1b38e549987c6d11a /sway/ipc-server.c | |
parent | sway: Add non-desktop-output type (diff) | |
download | sway-52f0e3a4d5bc5900df821b82a2c6941f57eaca25.tar.gz sway-52f0e3a4d5bc5900df821b82a2c6941f57eaca25.tar.zst sway-52f0e3a4d5bc5900df821b82a2c6941f57eaca25.zip |
sway: add non-desktop outputs to json when running `swaymsg -t get_outputs`
Diffstat (limited to 'sway/ipc-server.c')
-rw-r--r-- | sway/ipc-server.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c index 3cbf7889..00b01d7d 100644 --- a/sway/ipc-server.c +++ b/sway/ipc-server.c | |||
@@ -685,6 +685,12 @@ void ipc_client_handle_command(struct ipc_client *client, uint32_t payload_lengt | |||
685 | ipc_json_describe_disabled_output(output)); | 685 | ipc_json_describe_disabled_output(output)); |
686 | } | 686 | } |
687 | } | 687 | } |
688 | |||
689 | for (int i = 0; i < root->non_desktop_outputs->length; i++) { | ||
690 | struct sway_output_non_desktop *non_desktop_output = root->non_desktop_outputs->items[i]; | ||
691 | json_object_array_add(outputs, ipc_json_describe_non_desktop_output(non_desktop_output)); | ||
692 | } | ||
693 | |||
688 | const char *json_string = json_object_to_json_string(outputs); | 694 | const char *json_string = json_object_to_json_string(outputs); |
689 | ipc_send_reply(client, payload_type, json_string, | 695 | ipc_send_reply(client, payload_type, json_string, |
690 | (uint32_t)strlen(json_string)); | 696 | (uint32_t)strlen(json_string)); |