From efa5ee79472b84da31e4dd0d072a6fd74e187ce2 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Mon, 8 Jun 2026 21:18:11 +0800 Subject: [PATCH] input/seat: prevent layer surfaces from focusing under session lock When the screen is locked, `server.session_lock.lock` is active and keyboard input must be forced to the screen lock surface. While `seat_set_focus` checked for an active session lock and redirected focus, `seat_set_focus_layer` was missing the same check. This allowed layer surfaces to steal keyboard input while the screen lock was active. This commit adds the missing session check to `seat_set_focus_layer` to prevent layer surfaces from being focused when the screen is locked. --- sway/input/seat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sway/input/seat.c b/sway/input/seat.c index 0434d637c..1f108623d 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -1312,6 +1312,9 @@ void seat_set_focus_layer(struct sway_seat *seat, } else if (!layer) { return; } + if (server.session_lock.lock) { + return; + } assert(layer->surface->mapped); if (layer->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP && layer->current.keyboard_interactive