diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-04-07 16:14:12 -0400 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2018-04-07 16:14:12 -0400 |
commit | de811823b60cc33fb6a65c6f1045e9d1fb497243 (patch) | |
tree | b8ef5b4e6da520708a199524d0d5bb40974b67ee /sway | |
parent | c0f9ee7bd1fc70672dcf64a19c9fbbf5a80b12b0 (diff) | |
download | sway-de811823b60cc33fb6a65c6f1045e9d1fb497243.tar.xz |
seat focus inactive children foreach
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seat.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 1a646715..3656d6b6 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -106,6 +106,20 @@ static struct sway_container *seat_get_focus_by_type(struct sway_seat *seat, return NULL; } +void seat_focus_inactive_children_for_each(struct sway_seat *seat, + struct sway_container *container, + void (*f)(struct sway_container *container, void *data), void *data) { + struct sway_seat_container *current = NULL; + wl_list_for_each(current, &seat->focus_stack, link) { + if (current->container->parent == NULL) { + continue; + } + if (current->container->parent == container) { + f(current->container, data); + } + } +} + struct sway_container *seat_get_focus_inactive_view(struct sway_seat *seat, struct sway_container *container) { return seat_get_focus_by_type(seat, container, C_VIEW); |