mirror of
https://github.com/swaywm/sway.git
synced 2025-11-04 13:29:52 -05:00
ipc: add output modes
This commit is contained in:
parent
3035db74df
commit
4ab5506064
2 changed files with 38 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue