Windows QPA: Fix text input with Input Method Editors
Removes a workaround that was added to force the Windows On-Screen Keyboard to automatically appear on Windows tablets, since it is no longer needed in currently supported Windows releases and was interfering with text input using Input Method Editors. Also remove logic for programmatically disabling the OSK, since it is no longer needed here as well, and is already supported in the UI Automation code elsewhere in the Windows QPA. Pick-to: 6.2 6.3 Fixes: QTBUG-98003 Change-Id: I6c4781852a5e9f96330d54a24ee3893dcd43a28c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
75f2270293
commit
067b538641
|
|
@ -237,23 +237,9 @@ void QWindowsInputContext::showInputPanel()
|
|||
if (!m_caretCreated && m_transparentBitmap)
|
||||
m_caretCreated = CreateCaret(platformWindow->handle(), m_transparentBitmap, 0, 0);
|
||||
|
||||
// For some reason, the on-screen keyboard is only triggered on the Surface
|
||||
// with Windows 10 if the Windows IME is (re)enabled _after_ the caret is shown.
|
||||
if (m_caretCreated) {
|
||||
cursorRectChanged();
|
||||
// We only call ShowCaret() on Windows 10 after 1703 as in earlier versions
|
||||
// the caret would actually be visible (QTBUG-74492) and the workaround for
|
||||
// the Surface seems unnecessary there anyway. But leave it hidden for IME.
|
||||
// Only trigger the native OSK if the Qt OSK is not in use.
|
||||
static bool imModuleEmpty = qEnvironmentVariableIsEmpty("QT_IM_MODULE");
|
||||
bool nativeVKDisabled = QCoreApplication::testAttribute(Qt::AA_DisableNativeVirtualKeyboard);
|
||||
if (imModuleEmpty && !nativeVKDisabled) {
|
||||
ShowCaret(platformWindow->handle());
|
||||
} else {
|
||||
HideCaret(platformWindow->handle());
|
||||
}
|
||||
setWindowsImeEnabled(platformWindow, false);
|
||||
setWindowsImeEnabled(platformWindow, true);
|
||||
ShowCaret(platformWindow->handle());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue