When the focus changes make sure that the IME finishes correctly

When clicking onto another widget while in the middle of composing should
cause it to be seen as an acceptance of the composed text so far instead
of just cancelling it outright.

This was validated against the Japanese, Korean and Chinese IMEs on
Windows 7.

Task-number: QTBUG-42344
Change-Id: I03be0cd099840f51a9550929f33e2afbbf31e85a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Andy Shaw 2015-08-04 17:49:39 +02:00
parent bec8c726bf
commit d2f0f46c45

View File

@ -206,7 +206,7 @@ void QWindowsInputContext::setFocusObject(QObject *object)
// remains active when this happens resulting in a lock-up. Consecutive
// key events still have VK_PROCESSKEY set and are thus ignored.
if (m_compositionContext.isComposing)
imeNotifyCancelComposition(m_compositionContext.hwnd);
reset();
const QWindow *window = QGuiApplication::focusWindow();
if (object && window && window->handle()) {