Windows/Input context: Update enabling of IME in in update(), too.
Amend change b55f88caba
by splitting
out the enabling into a separate function and call that when
QWindowsInputContext::update() is triggered to reflect updates
of the microfocus in QGraphicsView or item view widgets.
Task-number: QTBUG-47679
Task-number: QTBUG-47705
Task-number: QTBUG-40691
Change-Id: I84a6647944f1aaedcd72d7060cc90e29a177f577
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
This commit is contained in:
parent
2518c4c907
commit
b14550fa45
@ -200,18 +200,27 @@ void QWindowsInputContext::reset()
|
||||
doneContext();
|
||||
}
|
||||
|
||||
void QWindowsInputContext::setFocusObject(QObject *object)
|
||||
void QWindowsInputContext::setFocusObject(QObject *)
|
||||
{
|
||||
// ### fixme: On Windows 8.1, it has been observed that the Input context
|
||||
// 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)
|
||||
reset();
|
||||
updateEnabled();
|
||||
}
|
||||
|
||||
void QWindowsInputContext::updateEnabled()
|
||||
{
|
||||
if (!QGuiApplication::focusObject())
|
||||
return;
|
||||
const QWindow *window = QGuiApplication::focusWindow();
|
||||
if (object && window && window->handle()) {
|
||||
if (window && window->handle()) {
|
||||
QWindowsWindow *platformWindow = QWindowsWindow::baseWindowOf(window);
|
||||
if (inputMethodAccepted()) {
|
||||
const bool accepted = inputMethodAccepted();
|
||||
if (QWindowsContext::verbose > 1)
|
||||
qCDebug(lcQpaInputMethods) << __FUNCTION__ << window << "accepted=" << accepted;
|
||||
if (accepted) {
|
||||
// Re-enable IME by associating default context saved on first disabling.
|
||||
if (platformWindow->testFlag(QWindowsWindow::InputMethodDisabled)) {
|
||||
ImmAssociateContext(platformWindow->handle(), QWindowsInputContext::m_defaultContext);
|
||||
@ -235,6 +244,8 @@ void QWindowsInputContext::setFocusObject(QObject *object)
|
||||
|
||||
void QWindowsInputContext::update(Qt::InputMethodQueries queries)
|
||||
{
|
||||
if (queries & Qt::ImEnabled)
|
||||
updateEnabled();
|
||||
QPlatformInputContext::update(queries);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ private:
|
||||
void doneContext();
|
||||
void startContextComposition();
|
||||
void endContextComposition();
|
||||
void updateEnabled();
|
||||
|
||||
const DWORD m_WM_MSIME_MOUSE;
|
||||
static HIMC m_defaultContext;
|
||||
|
Loading…
Reference in New Issue
Block a user