aboutsummaryrefslogtreecommitdiff
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2019-02-23 07:49:40 -0800
committeremersion <contact@emersion.fr>2019-02-23 20:27:59 +0100
commitf84ac3f1148e2e25c68ed15b75ca69a694050328 (patch)
tree17f91842afadc0da2c803360c62598c494117e55 /sway/ipc-json.c
parentd1588e37390279c0e99304cda93da8c416292097 (diff)
ipc: add missing fields to disabled outputs
i3 requires all outputs to have certain fields, including 'primary', 'current_workspace', and 'rect' which were missing on disabled outputs. https://i3wm.org/docs/ipc.html#_outputs_reply
Diffstat (limited to 'sway/ipc-json.c')
-rw-r--r--sway/ipc-json.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index a2ab2bba..125df387 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -251,6 +251,7 @@ json_object *ipc_json_describe_disabled_output(struct sway_output *output) {
json_object_object_add(object, "name",
json_object_new_string(wlr_output->name));
json_object_object_add(object, "active", json_object_new_boolean(false));
+ json_object_object_add(object, "primary", json_object_new_boolean(false));
json_object_object_add(object, "make",
json_object_new_string(wlr_output->make));
json_object_object_add(object, "model",
@@ -259,6 +260,15 @@ json_object *ipc_json_describe_disabled_output(struct sway_output *output) {
json_object_new_string(wlr_output->serial));
json_object_object_add(object, "modes", json_object_new_array());
+ json_object_object_add(object, "current_workspace", NULL);
+
+ json_object *rect_object = json_object_new_object();
+ json_object_object_add(rect_object, "x", json_object_new_int(0));
+ json_object_object_add(rect_object, "y", json_object_new_int(0));
+ json_object_object_add(rect_object, "width", json_object_new_int(0));
+ json_object_object_add(rect_object, "height", json_object_new_int(0));
+ json_object_object_add(object, "rect", rect_object);
+
json_object_object_add(object, "percent", NULL);
return object;