diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-07 16:23:53 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-07 16:23:53 -0400 |
commit | 0ff22c1755a906309e08c0c45f4732c842e4636e (patch) | |
tree | 51d4747e6b090913f8d4835797ff17aec3d244f4 /sway | |
parent | de811823b60cc33fb6a65c6f1045e9d1fb497243 (diff) |
implement ipc focus stack
Diffstat (limited to 'sway')
-rw-r--r-- | sway/ipc-json.c | 10 |
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 } } +static void focus_inactive_children_iterator(struct sway_container *c, void *data) { + json_object *focus = data; + json_object_array_add(focus, json_object_new_int(c->id)); +} + json_object *ipc_json_describe_container(struct sway_container *c) { if (!(sway_assert(c, "Container must not be null."))) { return NULL; @@ -183,6 +188,11 @@ json_object *ipc_json_describe_container(struct sway_container *c) { json_object_object_add(object, "focused", json_object_new_boolean(focused)); + json_object *focus = json_object_new_array(); + seat_focus_inactive_children_for_each(seat, c, + focus_inactive_children_iterator, focus); + json_object_object_add(object, "focus", focus); + switch (c->type) { case C_ROOT: ipc_json_describe_root(c, object); |