Windows QPA: Fix Korean IME removing words when using CTRL shortcuts

Ignore the WM_IME_ENDCOMPOSITION message in that case.

Done-with: Tobias Koenig <tobias.koenig@kdab.com>
Task-number: QTBUG-58300
Change-Id: I9506754a149905222a324b85634964fce398d3ac
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Friedemann Kleint 2018-04-11 09:51:19 +02:00
parent 12559058b0
commit 994e0e4c36

View File

@ -530,6 +530,14 @@ bool QWindowsInputContext::endComposition(HWND hwnd)
if (m_compositionContext.focusObject.isNull())
return false;
// QTBUG-58300: Ignore WM_IME_ENDCOMPOSITION when CTRL is pressed to prevent
// for example the text being cleared when pressing CTRL+A
if (m_locale.language() == QLocale::Korean
&& QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier)) {
reset();
return true;
}
m_endCompositionRecursionGuard = true;
imeNotifyCancelComposition(m_compositionContext.hwnd);