From 8ab656541b25a5a3e9dbaa020c97203e3734f56e Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Thu, 3 Sep 2020 14:09:31 +0530 Subject: [PATCH] textinput: introduce a signal for when the state should be committed In v1 to v3 of textinput protocol, updates for the text input state needs to be updated explcitly using commit or update state request, so send out this information to compositor, which can use it to update the input method state. --- src/wayland/server/textinput_interface.h | 5 +++++ src/wayland/server/textinput_interface_v2.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wayland/server/textinput_interface.h b/src/wayland/server/textinput_interface.h index b3f1072571..244ede65e8 100644 --- a/src/wayland/server/textinput_interface.h +++ b/src/wayland/server/textinput_interface.h @@ -396,6 +396,11 @@ Q_SIGNALS: * @see surface **/ void enabledChanged(); + /** + * Emitted whenever TextInputInterface should commit the current state. + * @see requestReset + **/ + void stateCommitted(uint32_t serial); protected: class Private; diff --git a/src/wayland/server/textinput_interface_v2.cpp b/src/wayland/server/textinput_interface_v2.cpp index b0b58133f8..2af01c0f80 100644 --- a/src/wayland/server/textinput_interface_v2.cpp +++ b/src/wayland/server/textinput_interface_v2.cpp @@ -224,11 +224,11 @@ void TextInputUnstableV2Interface::Private::updateStateCallback(wl_client *clien { auto p = cast(resource); Q_ASSERT(*p->client == client); - Q_UNUSED(serial) // TODO: use other reason values reason if (reason == ZWP_TEXT_INPUT_V2_UPDATE_STATE_RESET) { emit p->q_func()->requestReset(); } + emit p->q_func()->stateCommitted(serial); } TextInputInterface::ContentHints TextInputUnstableV2Interface::Private::convertContentHint(uint32_t hint) const