diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 7b9bbf6e9e..fe3fe58689 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -230,6 +230,7 @@ void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServe if (!m_enabled) { return; } + Q_UNUSED(serial); auto t2 = waylandServer()->seat()->textInputV2(); auto inputContext = waylandServer()->inputMethod()->context(); @@ -241,19 +242,13 @@ void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServe } switch (reason) { case KWaylandServer::TextInputV2Interface::UpdateReason::StateChange: - inputContext->sendCommitState(serial); break; case KWaylandServer::TextInputV2Interface::UpdateReason::StateEnter: - waylandServer()->inputMethod()->sendActivate(); - inputContext->sendCommitState(serial); - break; case KWaylandServer::TextInputV2Interface::UpdateReason::StateFull: adoptInputMethodContext(); - inputContext->sendCommitState(serial); break; case KWaylandServer::TextInputV2Interface::UpdateReason::StateReset: inputContext->sendReset(); - inputContext->sendCommitState(serial); break; } } @@ -486,6 +481,7 @@ void InputMethod::adoptInputMethodContext() inputContext->sendSurroundingText(t3->surroundingText(), t3->surroundingTextCursorPosition(), t3->surroundingTextSelectionAnchor()); inputContext->sendContentType(t3->contentHints(), t3->contentPurpose()); } + inputContext->sendCommitState(m_serial++); connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keysym, this, &InputMethod::keysymReceived, Qt::UniqueConnection); connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::commitString, this, &InputMethod::commitString, Qt::UniqueConnection); diff --git a/src/inputmethod.h b/src/inputmethod.h index 0104ca05b6..7e448102ae 100644 --- a/src/inputmethod.h +++ b/src/inputmethod.h @@ -91,6 +91,7 @@ private: bool m_enabled = false; bool m_active = false; + quint32 m_serial = 0; QScopedPointer m_sni; QPointer m_inputClient; QPointer m_trackedClient;