mirror of
https://github.com/swaywm/sway.git
synced 2025-11-17 06:59:48 -05:00
Fix crash when deleting last child in a tabbed or stacked container
There was no `current` child because the container was destroyed. This makes it fall back to looking in the parent's current children list.
This commit is contained in:
parent
b11c9199a6
commit
32b865e610
3 changed files with 39 additions and 12 deletions
|
|
@ -829,6 +829,18 @@ struct sway_container *seat_get_active_child(struct sway_seat *seat,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct sway_container *seat_get_active_current_child(struct sway_seat *seat,
|
||||
struct sway_container *container) {
|
||||
struct sway_container *child = seat_get_active_child(seat, container);
|
||||
if (child) {
|
||||
return child;
|
||||
}
|
||||
if (container->current.children->length == 1) {
|
||||
return container->current.children->items[0];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct sway_container *seat_get_focus(struct sway_seat *seat) {
|
||||
if (!seat->has_focus) {
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue