aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/ipc-json.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 213c8fb6..977f1ecb 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -78,6 +78,20 @@ static void ipc_json_describe_output(swayc_t *container, json_object *object) {
json_object_new_string(ipc_json_get_output_transform(wlr_output->transform)));
// TODO WLR need to set "current_workspace" to the currently focused
// workspace in a way that makes sense with multiseat
+
+ json_object *modes_array = json_object_new_array();
+ struct wlr_output_mode *mode;
+ wl_list_for_each(mode, &wlr_output->modes, link) {
+ json_object *mode_object = json_object_new_object();
+ json_object_object_add(mode_object, "width",
+ json_object_new_int(mode->width));
+ json_object_object_add(mode_object, "height",
+ json_object_new_int(mode->height));
+ json_object_object_add(mode_object, "refresh",
+ json_object_new_int(mode->refresh));
+ json_object_array_add(modes_array, mode_object);
+ }
+ json_object_object_add(object, "modes", modes_array);
}
static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) {