aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorLibravatar Cole Mickens <cole.mickens@gmail.com>2018-11-02 01:34:16 -0700
committerLibravatar Cole Mickens <cole.mickens@gmail.com>2018-11-03 04:30:49 -0700
commitd05aeb77a00a957854c12b188b6a3268f7782df9 (patch)
tree945af0a83fe8a4768cbcb03c89a6f42ff83ceeea /sway/ipc-json.c
parentCorrection to dependency updates (diff)
downloadsway-d05aeb77a00a957854c12b188b6a3268f7782df9.tar.gz
sway-d05aeb77a00a957854c12b188b6a3268f7782df9.tar.zst
sway-d05aeb77a00a957854c12b188b6a3268f7782df9.zip
sway-ipc: includes current_mode for each output
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 20ab57b4..7cc965c8 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -136,13 +136,18 @@ static void ipc_json_describe_output(struct sway_output *output,
136 json_object_new_int(mode->width)); 136 json_object_new_int(mode->width));
137 json_object_object_add(mode_object, "height", 137 json_object_object_add(mode_object, "height",
138 json_object_new_int(mode->height)); 138 json_object_new_int(mode->height));
139 json_object_object_add(mode_object, "refresh",
140 json_object_new_int(mode->refresh));
141 json_object_array_add(modes_array, mode_object); 139 json_object_array_add(modes_array, mode_object);
142 } 140 }
143 141
144 json_object_object_add(object, "modes", modes_array); 142 json_object_object_add(object, "modes", modes_array);
145 143
144 json_object *current_mode_object = json_object_new_object();
145 json_object_object_add(current_mode_object, "width",
146 json_object_new_int(wlr_output->width));
147 json_object_object_add(current_mode_object, "height",
148 json_object_new_int(wlr_output->height));
149 json_object_object_add(object, "current_mode", current_mode_object);
150
146 struct sway_node *parent = node_get_parent(&output->node); 151 struct sway_node *parent = node_get_parent(&output->node);
147 struct wlr_box parent_box = {0, 0, 0, 0}; 152 struct wlr_box parent_box = {0, 0, 0, 0};
148 153