]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/layers: handle unmap without any outputs left
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 12 Feb 2025 14:14:16 +0000 (15:14 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 12 Feb 2025 14:38:18 +0000 (15:38 +0100)
src/layers.c

index fc0b2b6ff26ee19f3b06241feedd5f395ce5dc9d..6ce9527dbae62fcccff06f20c4256e9606a1269d 100644 (file)
@@ -136,6 +136,9 @@ try_to_focus_next_layer_or_toplevel(struct server *server)
 {
        struct seat *seat = &server->seat;
        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 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
         * one exists on the current workspace.
         */
+no_output:
        if (seat->focused_layer) {
                seat_set_focus_layer(seat, NULL);
        }