input method: Drop unused member variable

The preedit struct holds values that need to be effectively double
buffered till the preedit string is set. There is no need to store the
text in this struct as it is reset at the end of setPreeditString
This commit is contained in:
David Edmundson 2024-06-27 22:05:41 +00:00
parent 13b2c43b2b
commit d2c648f6cc
2 changed files with 2 additions and 5 deletions

View file

@ -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();
}

View file

@ -121,7 +121,6 @@ private:
struct
{
QString text = QString();
qint32 cursor = 0;
std::vector<std::pair<quint32, quint32>> highlightRanges;
} preedit;