mirror of
https://github.com/NickHu/sway
synced 2024-12-26 21:58:30 +01:00
implement ipc focus stack
This commit is contained in:
parent
de811823b6
commit
0ff22c1755
1 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue