diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 8c14de00f7..f43c161321 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -708,8 +708,7 @@ void InputMethod::setPreeditString(uint32_t serial, const QString &text, const Q } auto t3 = waylandServer()->seat()->textInputV3(); if (t3 && t3->isEnabled()) { - preedit.text = text; - if (!preedit.text.isEmpty()) { + if (!text.isEmpty()) { quint32 cursor = 0, cursorEnd = 0; if (preedit.cursor > 0) { cursor = cursorEnd = preedit.cursor; @@ -735,7 +734,7 @@ void InputMethod::setPreeditString(uint32_t serial, const QString &text, const Q } } - t3->sendPreEditString(preedit.text, cursor, cursorEnd); + t3->sendPreEditString(text, cursor, cursorEnd); } t3->done(); } @@ -966,7 +965,6 @@ bool InputMethod::isAvailable() const void InputMethod::resetPendingPreedit() { - preedit.text = QString(); preedit.cursor = 0; preedit.highlightRanges.clear(); } diff --git a/src/inputmethod.h b/src/inputmethod.h index 752e5d63d6..b1001d5c56 100644 --- a/src/inputmethod.h +++ b/src/inputmethod.h @@ -121,7 +121,6 @@ private: struct { - QString text = QString(); qint32 cursor = 0; std::vector> highlightRanges; } preedit;