Simplified seat logic for focusing a new lock surface

This commit is contained in:
Erik Reider 2026-05-15 11:10:00 +02:00
parent d757caf54f
commit 47a0b18d2a

View file

@ -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;
}