aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-json.c
diff options
context:
space:
mode:
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 f9c6c90b..6158fc29 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -166,6 +166,11 @@ static void ipc_json_describe_view(struct sway_container *c, json_object *object
166 } 166 }
167} 167}
168 168
169static void focus_inactive_children_iterator(struct sway_container *c, void *data) {
170 json_object *focus = data;
171 json_object_array_add(focus, json_object_new_int(c->id));
172}
173
169json_object *ipc_json_describe_container(struct sway_container *c) { 174json_object *ipc_json_describe_container(struct sway_container *c) {
170 if (!(sway_assert(c, "Container must not be null."))) { 175 if (!(sway_assert(c, "Container must not be null."))) {
171 return NULL; 176 return NULL;
@@ -183,6 +188,11 @@ json_object *ipc_json_describe_container(struct sway_container *c) {
183 json_object_object_add(object, "focused", 188 json_object_object_add(object, "focused",
184 json_object_new_boolean(focused)); 189 json_object_new_boolean(focused));
185 190
191 json_object *focus = json_object_new_array();
192 seat_focus_inactive_children_for_each(seat, c,
193 focus_inactive_children_iterator, focus);
194 json_object_object_add(object, "focus", focus);
195
186 switch (c->type) { 196 switch (c->type) {
187 case C_ROOT: 197 case C_ROOT:
188 ipc_json_describe_root(c, object); 198 ipc_json_describe_root(c, object);