From f819d0000e912cf77e9893bbee10b390bf4d288a Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Sat, 16 May 2026 19:29:50 +0800 Subject: [PATCH] input/seatop_default: fix focus on layer surface output switch When `focus_follows_mouse` is enabled and the cursor moves from one output to a layer surface (such as swaybar) on another output, Sway would previously focus the workspace node. This updates `check_focus_follows_mouse` to use `seat_get_focus_inactive()`, ensuring that the previously focused window on that workspace receives focus instead. --- sway/input/seatop_default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index df8232afc..64ef00922 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c @@ -565,7 +565,7 @@ static void check_focus_follows_mouse(struct sway_seat *seat, struct sway_output *hovered_output = wlr_output->data; if (focus && hovered_output != node_get_output(focus)) { struct sway_workspace *ws = output_get_active_workspace(hovered_output); - seat_set_focus(seat, &ws->node); + seat_set_focus(seat, seat_get_focus_inactive(seat, &ws->node)); transaction_commit_dirty(); } return;