aboutsummaryrefslogtreecommitdiff
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-06-07 19:26:55 +0100
committerGitHub <noreply@github.com>2018-06-07 19:26:55 +0100
commit2e289831ee3198f36e2c02bd4542fa4f6646a81b (patch)
tree7de104885aabb49f17739d7631ef6cd4f628e64a /sway/ipc-json.c
parent22c1c4beb4baa369f883fb5360c40158513c8e10 (diff)
parente072fbc6d98784e5610aa88251a15f64e30bbcae (diff)
Merge pull request #2108 from RedSoxFan/store-outputs
Allow outputs to be re-enabled
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 6d185449..5d402d1b 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -139,6 +139,26 @@ static void ipc_json_describe_output(struct sway_container *container, json_obje
json_object_object_add(object, "layout", json_object_new_string("output"));
}
+json_object *ipc_json_describe_disabled_output(struct sway_output *output) {
+ struct wlr_output *wlr_output = output->wlr_output;
+
+ json_object *object = json_object_new_object();
+
+ json_object_object_add(object, "type", json_object_new_string("output"));
+ json_object_object_add(object, "name",
+ wlr_output->name ? json_object_new_string(wlr_output->name) : NULL);
+ json_object_object_add(object, "active", json_object_new_boolean(false));
+ json_object_object_add(object, "make",
+ json_object_new_string(wlr_output->make));
+ json_object_object_add(object, "model",
+ json_object_new_string(wlr_output->model));
+ json_object_object_add(object, "serial",
+ json_object_new_string(wlr_output->serial));
+ json_object_object_add(object, "modes", json_object_new_array());
+
+ return object;
+}
+
static void ipc_json_describe_workspace(struct sway_container *workspace,
json_object *object) {
int num = isdigit(workspace->name[0]) ? atoi(workspace->name) : -1;