Handle empty tabbed/stacked containers when looking for popups

This commit is contained in:
Ryan Dwyer 2018-06-03 22:48:51 +10:00
parent e84166a734
commit 476dcc5bd9

View file

@ -681,10 +681,12 @@ static struct sway_container *popup_at_container(struct sway_container *parent,
if (parent->layout == L_TABBED || parent->layout == L_STACKED) { if (parent->layout == L_TABBED || parent->layout == L_STACKED) {
struct sway_seat *seat = input_manager_current_seat(input_manager); struct sway_seat *seat = input_manager_current_seat(input_manager);
struct sway_container *child = seat_get_active_child(seat, parent); struct sway_container *child = seat_get_active_child(seat, parent);
struct sway_container *c = if (child) {
popup_at_container(child, lx, ly, surface, sx, sy); struct sway_container *c =
if (c) { popup_at_container(child, lx, ly, surface, sx, sy);
return c; if (c) {
return c;
}
} }
} else { } else {
for (int i = 0; i < parent->children->length; ++i) { for (int i = 0; i < parent->children->length; ++i) {