From 994e0e4c36315fc7656568f9f1e546362dae5466 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 Apr 2018 09:51:19 +0200 Subject: Windows QPA: Fix Korean IME removing words when using CTRL shortcuts Ignore the WM_IME_ENDCOMPOSITION message in that case. Done-with: Tobias Koenig Task-number: QTBUG-58300 Change-Id: I9506754a149905222a324b85634964fce398d3ac Reviewed-by: Liang Qi --- src/plugins/platforms/windows/qwindowsinputcontext.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/plugins/platforms/windows/qwindowsinputcontext.cpp') diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index b9dd2c557e..2dbca6047c 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -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); -- cgit v1.2.3