diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-06-05 17:56:32 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-06-06 20:11:24 -0400 |
commit | a1b5b93d299bfe129f2b3409a7f642049fcce1d6 (patch) | |
tree | 4d87f5ab8f0f18ada1fc12a4eb4ba3b5d0350527 /sway/ipc-json.c | |
parent | Merge pull request #2116 from RedSoxFan/fix-2113 (diff) | |
download | sway-a1b5b93d299bfe129f2b3409a7f642049fcce1d6.tar.gz sway-a1b5b93d299bfe129f2b3409a7f642049fcce1d6.tar.zst sway-a1b5b93d299bfe129f2b3409a7f642049fcce1d6.zip |
Store sway_outputs so that they can be reenabled
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r-- | sway/ipc-json.c | 20 |
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 | |||
139 | json_object_object_add(object, "layout", json_object_new_string("output")); | 139 | json_object_object_add(object, "layout", json_object_new_string("output")); |
140 | } | 140 | } |
141 | 141 | ||
142 | json_object *ipc_json_describe_disabled_output(struct sway_output *output) { | ||
143 | struct wlr_output *wlr_output = output->wlr_output; | ||
144 | |||
145 | json_object *object = json_object_new_object(); | ||
146 | |||
147 | json_object_object_add(object, "type", json_object_new_string("output")); | ||
148 | json_object_object_add(object, "name", | ||
149 | wlr_output->name ? json_object_new_string(wlr_output->name) : NULL); | ||
150 | json_object_object_add(object, "active", json_object_new_boolean(false)); | ||
151 | json_object_object_add(object, "make", | ||
152 | json_object_new_string(wlr_output->make)); | ||
153 | json_object_object_add(object, "model", | ||
154 | json_object_new_string(wlr_output->model)); | ||
155 | json_object_object_add(object, "serial", | ||
156 | json_object_new_string(wlr_output->serial)); | ||
157 | json_object_object_add(object, "modes", json_object_new_array()); | ||
158 | |||
159 | return object; | ||
160 | } | ||
161 | |||
142 | static void ipc_json_describe_workspace(struct sway_container *workspace, | 162 | static void ipc_json_describe_workspace(struct sway_container *workspace, |
143 | json_object *object) { | 163 | json_object *object) { |
144 | int num = isdigit(workspace->name[0]) ? atoi(workspace->name) : -1; | 164 | int num = isdigit(workspace->name[0]) ? atoi(workspace->name) : -1; |