From 43960fbfc23bab9671c7f23a7ce42f3af58ab1a5 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Fri, 13 Jun 2025 18:13:35 +0000 Subject: text_input: Don't relay IM state from unfocused windows Otherwise, applications can enable their text input and affect IM state while a different application is focused. --- sway/input/text_input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/input/text_input.c b/sway/input/text_input.c index 2729db62..c907585f 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c @@ -264,6 +264,10 @@ static void handle_text_input_commit(struct wl_listener *listener, void *data) { struct sway_text_input *text_input = wl_container_of(listener, text_input, text_input_commit); + if (text_input->input->focused_surface == NULL) { + sway_log(SWAY_DEBUG, "Unfocused text input tried to commit an update"); + return; + } if (!text_input->input->current_enabled) { sway_log(SWAY_INFO, "Inactive text input tried to commit an update"); return; -- cgit v1.2.3