From c55d6624851474b1c6de790e9d99d552bc345cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 22 Nov 2025 23:16:59 +0100 Subject: [PATCH] input-method-relay: Inform the input method that we submitted preedit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we submit preedit on focus change we need to let the input method know that this happened, otherwise it may send the same preedit again. Closes: https://gitlab.com/schmiddi-on-mobile/flare/-/issues/272#note_2900347912 Signed-off-by: Guido Günther Part-of: --- protocols/meson.build | 1 + src/input-method-relay.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/protocols/meson.build b/protocols/meson.build index 6ef0be5d3..44e278e6c 100644 --- a/protocols/meson.build +++ b/protocols/meson.build @@ -12,6 +12,7 @@ wayland_protocols = [ [wl_protocol_dir, 'staging/ext-image-capture-source/ext-image-capture-source-v1.xml'], [wl_protocol_dir, 'staging/ext-image-copy-capture/ext-image-copy-capture-v1.xml'], [wl_protocol_dir, 'unstable/pointer-constraints/pointer-constraints-unstable-v1.xml'], + [wl_protocol_dir, 'unstable/text-input/text-input-unstable-v3.xml'], [wl_protocol_dir, 'unstable/xdg-decoration/xdg-decoration-unstable-v1.xml'], ['gtk-shell.xml'], ['phoc-device-state-unstable-v1.xml'], diff --git a/src/input-method-relay.c b/src/input-method-relay.c index 68dbfda9b..aeab462b1 100644 --- a/src/input-method-relay.c +++ b/src/input-method-relay.c @@ -6,6 +6,8 @@ #include "server.h" #include "input-method-relay.h" +#include "text-input-unstable-v3-protocol.h" + #include #include @@ -300,6 +302,11 @@ submit_preedit (PhocInputMethodRelay *self, PhocTextInput *text_input) wlr_text_input_v3_send_commit_string (text_input->input, preedit->text); g_clear_pointer (&preedit->text, g_free); wlr_text_input_v3_send_done (text_input->input); + + /* As we submitted the preedit the input method needs to forget it too: */ + wlr_input_method_v2_send_text_change_cause (self->input_method, + ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_OTHER); + wlr_input_method_v2_send_done (self->input_method); } -- GitLab