diff options
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 63c182f2..763fb3fe 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c @@ -240,10 +240,7 @@ static json_object *ipc_json_create_node(int id, const char* type, char *name, return object; } -static void ipc_json_describe_output(struct sway_output *output, - json_object *object) { - struct wlr_output *wlr_output = output->wlr_output; - +static void ipc_json_describe_wlr_output(struct wlr_output *wlr_output, json_object *object) { json_object_object_add(object, "primary", json_object_new_boolean(false)); json_object_object_add(object, "make", json_object_new_string(wlr_output->make ? wlr_output->make : "Unknown")); @@ -267,11 +264,17 @@ static void ipc_json_describe_output(struct sway_output *output, json_object_object_add(object, "modes", modes_array); } +static void ipc_json_describe_output(struct sway_output *output, + json_object *object) { + ipc_json_describe_wlr_output(output->wlr_output, object); +} + static void ipc_json_describe_enabled_output(struct sway_output *output, json_object *object) { ipc_json_describe_output(output, object); struct wlr_output *wlr_output = output->wlr_output; + json_object_object_add(object, "non_desktop", json_object_new_boolean(false)); json_object_object_add(object, "active", json_object_new_boolean(true)); json_object_object_add(object, "dpms", json_object_new_boolean(wlr_output->enabled)); @@ -349,6 +352,7 @@ json_object *ipc_json_describe_disabled_output(struct sway_output *output) { ipc_json_describe_output(output, object); + json_object_object_add(object, "non_desktop", json_object_new_boolean(false)); json_object_object_add(object, "type", json_object_new_string("output")); json_object_object_add(object, "name", json_object_new_string(wlr_output->name)); @@ -370,6 +374,21 @@ json_object *ipc_json_describe_disabled_output(struct sway_output *output) { return object; } +json_object *ipc_json_describe_non_desktop_output(struct sway_output_non_desktop *output) { + struct wlr_output *wlr_output = output->wlr_output; + + json_object *object = json_object_new_object(); + + ipc_json_describe_wlr_output(wlr_output, object); + + json_object_object_add(object, "non_desktop", json_object_new_boolean(true)); + json_object_object_add(object, "type", json_object_new_string("output")); + json_object_object_add(object, "name", + json_object_new_string(wlr_output->name)); + + return object; +} + static json_object *ipc_json_describe_scratchpad_output(void) { struct wlr_box box; root_get_box(root, &box); |