From 47a0b18d2a00c8e42816325310798869f1401c07 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Fri, 15 May 2026 11:10:00 +0200 Subject: [PATCH] Simplified seat logic for focusing a new lock surface --- sway/input/seat.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/sway/input/seat.c b/sway/input/seat.c index 24e663f1a..ca6c2ec2e 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -1266,20 +1266,9 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) { seat_set_workspace_focus(seat, node); } if (server.session_lock.lock) { - struct sway_output *output = NULL; - if (node != NULL) { - switch (node->type) { - case N_OUTPUT: - output = node->sway_output; - break; - case N_WORKSPACE: - output = node->sway_workspace->output; - break; - default: - break; - } - } - if (output != NULL) { + // Try focusing the current sway_output's lock-surface + struct sway_output *output = node ? node_get_output(node) : NULL; + if (output) { sway_session_lock_focus_output(server.session_lock.lock, output); return; }