Merge pull request #2099 from RyanDwyer/fix-seat-get-active-child

Fix seat_get_active_child
This commit is contained in:
emersion 2018-06-03 18:46:48 +01:00 committed by GitHub
commit 6d0ad6a1ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -728,15 +728,15 @@ 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) {
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 NULL;
}
while (focus->parent != container) {
focus = focus->parent;
}
return focus;
}
struct sway_container *seat_get_focus(struct sway_seat *seat) {
if (!seat->has_focus) {