Fix text input v3 related protocol usage.

zwp_input_method_v1 does not support generic double buffered event.
deleteSurroundingText need to be followed with done().
zwp_input_method_v1 preedit event order is preeditCursor,
preeditStyling, preeditString. To align it with text-input-v3 semantices,
send done() after receiving preedit_string() from input method.
This commit is contained in:
Weng Xuetian 2021-12-19 00:12:31 -08:00
parent c07d3ce7ea
commit bd40db7dd1
No known key found for this signature in database
GPG key ID: 8E8B898CBF2412F9

View file

@ -416,6 +416,7 @@ void InputMethod::deleteSurroundingText(int32_t index, uint32_t length)
auto t3 = waylandServer()->seat()->textInputV3();
if (t3 && t3->isEnabled()) {
t3->deleteSurroundingText(index, length);
t3->done();
}
}
@ -455,7 +456,6 @@ void InputMethod::setPreeditCursor(qint32 index)
if (t3 && t3->isEnabled()) {
preedit.begin = index;
preedit.end = index;
t3->sendPreEditString(preedit.text, preedit.begin, preedit.end);
}
}
@ -471,6 +471,7 @@ void InputMethod::setPreeditString(uint32_t serial, const QString &text, const Q
if (t3 && t3->isEnabled()) {
preedit.text = text;
t3->sendPreEditString(preedit.text, preedit.begin, preedit.end);
t3->done();
}
}