aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Fidan <dev@print0.net>2025-06-13 18:13:35 +0000
committerSimon Ser <contact@emersion.fr>2025-06-14 09:19:17 +0200
commit6c27c2cdf263090252df4304f00b8425d0edd091 (patch)
tree95e5692b76802febae751595c6b8f899a495a212
parent1ab573bf54eec653123f3c6f26ae14c3fcac605a (diff)
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.
-rw-r--r--sway/input/text_input.c4
1 files changed, 4 insertions, 0 deletions
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;