aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Ranieri Althoff <ranisalt@gmail.com>2019-04-15 21:46:50 -0300
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-16 00:16:20 -0400
commitfd6903673b084ef16f18e228405cb50adf28550d (patch)
tree0ac0b33d4bb1f63ccea152781b0b4108ec699fc7 /sway/ipc-json.c
parentAdd deprecation warnings for new_float, new_window, and force_focus_wrapping. (diff)
downloadsway-fd6903673b084ef16f18e228405cb50adf28550d.tar.gz
sway-fd6903673b084ef16f18e228405cb50adf28550d.tar.zst
sway-fd6903673b084ef16f18e228405cb50adf28550d.zip
Send disabled output available modes on IPC get_outputs
- Also fix missing trailing newline on pretty print Signed-off-by: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com>
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 4ccf6dfd..4af8d34b 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -240,7 +240,21 @@ json_object *ipc_json_describe_disabled_output(struct sway_output *output) {
240 json_object_new_string(wlr_output->model)); 240 json_object_new_string(wlr_output->model));
241 json_object_object_add(object, "serial", 241 json_object_object_add(object, "serial",
242 json_object_new_string(wlr_output->serial)); 242 json_object_new_string(wlr_output->serial));
243 json_object_object_add(object, "modes", json_object_new_array()); 243
244 json_object *modes_array = json_object_new_array();
245 struct wlr_output_mode *mode;
246 wl_list_for_each(mode, &wlr_output->modes, link) {
247 json_object *mode_object = json_object_new_object();
248 json_object_object_add(mode_object, "width",
249 json_object_new_int(mode->width));
250 json_object_object_add(mode_object, "height",
251 json_object_new_int(mode->height));
252 json_object_object_add(mode_object, "refresh",
253 json_object_new_int(mode->refresh));
254 json_object_array_add(modes_array, mode_object);
255 }
256
257 json_object_object_add(object, "modes", modes_array);
244 258
245 json_object_object_add(object, "current_workspace", NULL); 259 json_object_object_add(object, "current_workspace", NULL);
246 260