diff options
-rw-r--r-- | sway/input/seat.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c index 3656d6b6..9f44955c 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c | |||
@@ -413,10 +413,23 @@ void seat_set_focus_warp(struct sway_seat *seat, | |||
413 | if (container) { | 413 | if (container) { |
414 | struct sway_seat_container *seat_con = | 414 | struct sway_seat_container *seat_con = |
415 | seat_container_from_container(seat, container); | 415 | seat_container_from_container(seat, container); |
416 | if (!seat_con) { | 416 | if (seat_con == NULL) { |
417 | return; | 417 | return; |
418 | } | 418 | } |
419 | 419 | ||
420 | // put all the anscestors of this container on top of the focus stack | ||
421 | struct sway_seat_container *parent = | ||
422 | seat_container_from_container(seat, | ||
423 | seat_con->container->parent); | ||
424 | while (parent) { | ||
425 | wl_list_remove(&parent->link); | ||
426 | wl_list_insert(&seat->focus_stack, &parent->link); | ||
427 | |||
428 | parent = | ||
429 | seat_container_from_container(seat, | ||
430 | parent->container->parent); | ||
431 | } | ||
432 | |||
420 | wl_list_remove(&seat_con->link); | 433 | wl_list_remove(&seat_con->link); |
421 | wl_list_insert(&seat->focus_stack, &seat_con->link); | 434 | wl_list_insert(&seat->focus_stack, &seat_con->link); |
422 | 435 | ||