src/layers: handle unmap without any outputs left

This commit is contained in:
Consolatis 2025-02-12 15:14:16 +01:00
parent a4d1fcfef2
commit bb64dc81d6

View file

@ -136,6 +136,9 @@ try_to_focus_next_layer_or_toplevel(struct server *server)
{ {
struct seat *seat = &server->seat; struct seat *seat = &server->seat;
struct output *output = output_nearest_to_cursor(server); struct output *output = output_nearest_to_cursor(server);
if (!output) {
goto no_output;
}
enum zwlr_layer_shell_v1_layer overlay = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; enum zwlr_layer_shell_v1_layer overlay = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY;
enum zwlr_layer_shell_v1_layer top = ZWLR_LAYER_SHELL_V1_LAYER_TOP; enum zwlr_layer_shell_v1_layer top = ZWLR_LAYER_SHELL_V1_LAYER_TOP;
@ -169,6 +172,7 @@ try_to_focus_next_layer_or_toplevel(struct server *server)
* Unfocus the current layer-surface and focus the topmost toplevel if * Unfocus the current layer-surface and focus the topmost toplevel if
* one exists on the current workspace. * one exists on the current workspace.
*/ */
no_output:
if (seat->focused_layer) { if (seat->focused_layer) {
seat_set_focus_layer(seat, NULL); seat_set_focus_layer(seat, NULL);
} }