summaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/ipc-json.c')
-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) {
78 json_object_new_string(ipc_json_get_output_transform(wlr_output->transform))); 78 json_object_new_string(ipc_json_get_output_transform(wlr_output->transform)));
79 // TODO WLR need to set "current_workspace" to the currently focused 79 // TODO WLR need to set "current_workspace" to the currently focused
80 // workspace in a way that makes sense with multiseat 80 // workspace in a way that makes sense with multiseat
81
82 json_object *modes_array = json_object_new_array();
83 struct wlr_output_mode *mode;
84 wl_list_for_each(mode, &wlr_output->modes, link) {
85 json_object *mode_object = json_object_new_object();
86 json_object_object_add(mode_object, "width",
87 json_object_new_int(mode->width));
88 json_object_object_add(mode_object, "height",
89 json_object_new_int(mode->height));
90 json_object_object_add(mode_object, "refresh",
91 json_object_new_int(mode->refresh));
92 json_object_array_add(modes_array, mode_object);
93 }
94 json_object_object_add(object, "modes", modes_array);
81} 95}
82 96
83static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) { 97static void ipc_json_describe_workspace(swayc_t *workspace, json_object *object) {