commit 6d0ad6a1ed1d86863efe6eeb0d2aea4e1055d22f
parent 4bc88772ec15ce0070fb06fe3c242cb65dc34b01
Author: emersion <contact@emersion.fr>
Date: Sun, 3 Jun 2018 18:46:48 +0100
Merge pull request #2099 from RyanDwyer/fix-seat-get-active-child
Fix seat_get_active_child
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sway/input/seat.c b/sway/input/seat.c
@@ -728,14 +728,14 @@ struct sway_container *seat_get_focus_inactive(struct sway_seat *seat,
struct sway_container *seat_get_active_child(struct sway_seat *seat,
struct sway_container *container) {
- struct sway_container *focus = seat_get_focus_inactive(seat, container);
- if (!focus) {
- return NULL;
- }
- while (focus->parent != container) {
- focus = focus->parent;
+ struct sway_seat_container *current = NULL;
+ wl_list_for_each(current, &seat->focus_stack, link) {
+ if (current->container->parent == container &&
+ current->container->layout != L_FLOATING) {
+ return current->container;
+ }
}
- return focus;
+ return NULL;
}
struct sway_container *seat_get_focus(struct sway_seat *seat) {