textInputV3: Prevent recursive update calls
If a 'done' which the compositor sends doesn't make any update in the client side, an additional event and updates will be skipped. Fixes: QTBUG-126275 Pick-to: 6.8 Change-Id: I86bebb3cc645f46ec2bfc6ef587ff86b76d44c9e Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
8784a01787
commit
62f4289cde
@ -129,6 +129,14 @@ void QWaylandTextInputv3::zwp_text_input_v3_done(uint32_t serial)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((m_pendingPreeditString == m_currentPreeditString)
|
||||
&& (m_pendingCommitString.isEmpty() && m_pendingDeleteBeforeText == 0
|
||||
&& m_pendingDeleteAfterText == 0)) {
|
||||
// Current done doesn't need additional updates
|
||||
m_pendingPreeditString.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
qCDebug(qLcQpaWaylandTextInput) << Q_FUNC_INFO << "PREEDIT" << m_pendingPreeditString.text << m_pendingPreeditString.cursorBegin;
|
||||
|
||||
QList<QInputMethodEvent::Attribute> attributes;
|
||||
|
@ -74,6 +74,11 @@ private:
|
||||
cursorBegin = 0;
|
||||
cursorEnd = 0;
|
||||
}
|
||||
friend bool operator==(const PreeditInfo& lhs, const PreeditInfo& rhs) {
|
||||
return (lhs.text == rhs.text)
|
||||
&& (lhs.cursorBegin == rhs.cursorBegin)
|
||||
&& (lhs.cursorEnd == rhs.cursorEnd);
|
||||
}
|
||||
};
|
||||
|
||||
PreeditInfo m_pendingPreeditString;
|
||||
|
Loading…
x
Reference in New Issue
Block a user