From bd40db7dd1276e17c41387cc6653b7cdb7481763 Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Sun, 19 Dec 2021 00:12:31 -0800 Subject: [PATCH] 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. --- src/inputmethod.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index 24ee6bd0a8..d1e821ee0c 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -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(); } }