Fixed another crash

This commit is contained in:
Keith Bowes 2025-02-27 11:44:05 -05:00
parent db79d83076
commit 606663a390

View file

@ -173,9 +173,12 @@ static void handle_unmap(struct wl_listener *listener, void *data) {
seat_set_focus_layer(seat, NULL); seat_set_focus_layer(seat, NULL);
} }
struct wb_toplevel *toplevel = wl_container_of(surface->server->toplevels.next, toplevel, link); if (!wl_list_empty(&surface->server->toplevels)) {
if (toplevel && toplevel->scene_tree && toplevel->scene_tree->node.enabled) { struct wb_toplevel *toplevel =
focus_toplevel(toplevel); wl_container_of(surface->server->toplevels.next, toplevel, link);
if (toplevel && toplevel->scene_tree && toplevel->scene_tree->node.enabled) {
focus_toplevel(toplevel);
}
} }
} }