From 8420113af5fb82ac2d42253c7fd9e998d4e3eb16 Mon Sep 17 00:00:00 2001 From: hack-heart <43978612+hack-heart@users.noreply.github.com> Date: Tue, 10 Mar 2026 00:09:37 -0700 Subject: [PATCH] set has_focus to false when focus is NULL Set has_focus to false in seat_unfocus_unless_client when seat_get_focus() returns NULL. --- sway/input/seat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sway/input/seat.c b/sway/input/seat.c index 9709f8c57..950d6de9f 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -1344,7 +1344,9 @@ void seat_unfocus_unless_client(struct sway_seat *seat, struct wl_client *client } if (seat->has_focus) { struct sway_node *focus = seat_get_focus(seat); - if (focus && node_is_view(focus) && wl_resource_get_client( + if (!focus) { + seat->has_focus = false; + } else if (node_is_view(focus) && wl_resource_get_client( focus->sway_container->view->surface->resource) != client) { seat_set_focus(seat, NULL); }