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.
This commit is contained in:
Bhushan Shah 2020-09-03 14:09:31 +05:30 committed by Bhushan Shah
parent 03f5339302
commit 8ab656541b
2 changed files with 6 additions and 1 deletions

View file

@ -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;

View file

@ -224,11 +224,11 @@ void TextInputUnstableV2Interface::Private::updateStateCallback(wl_client *clien
{
auto p = cast<Private>(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