From cc5a249e9e26f66a915f56d5a9681b890dede13c Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Wed, 15 May 2024 12:21:22 +0200 Subject: [PATCH] TextInput: ignore enable requests without focus (cherry picked from commit b35a40b9dfa3e70dbdc11e8383c584164b475420) --- river/TextInput.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/river/TextInput.zig b/river/TextInput.zig index 2b6af49..d513758 100644 --- a/river/TextInput.zig +++ b/river/TextInput.zig @@ -66,6 +66,11 @@ fn handleEnable(listener: *wl.Listener(*wlr.TextInputV3), _: *wlr.TextInputV3) v const text_input = @fieldParentPtr(TextInput, "enable", listener); const seat: *Seat = @ptrFromInt(text_input.wlr_text_input.seat.data); + if (text_input.wlr_text_input.focused_surface == null) { + log.err("client requested to enable text input without focus, ignoring request", .{}); + return; + } + // The same text_input object may be enabled multiple times consecutively // without first disabling it. Enabling a different text input object without // first disabling the current one is disallowed by the protocol however.