From 6d3aa0ac8c99fe81e141d9e51c348019c3c8c90e Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Wed, 15 Apr 2026 16:14:40 -0400 Subject: [PATCH] input/seat: end keyboard grab when clearing focus When focus leaves a surface, ensure any active keyboard grab is terminated. This prevents stale xdg-popup grabs from persisting after the popup is destroyed, which could otherwise cause keyboard input to remain stuck on the old window. fixes #8919 --- sway/input/seat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/input/seat.c b/sway/input/seat.c index ebdbd91ed..42e37bf03 100644 --- a/sway/input/seat.c +++ b/sway/input/seat.c @@ -14,7 +14,6 @@ #include #include #include -#include "config.h" #include "list.h" #include "log.h" #include "sway/config.h" @@ -1080,6 +1079,7 @@ static void send_unfocus(struct sway_container *con, void *data) { static void seat_send_unfocus(struct sway_node *node, struct sway_seat *seat) { sway_cursor_constrain(seat->cursor, NULL); wlr_seat_keyboard_notify_clear_focus(seat->wlr_seat); + wlr_seat_keyboard_end_grab(seat->wlr_seat); if (node->type == N_WORKSPACE) { workspace_for_each_container(node->sway_workspace, send_unfocus, seat); } else {