diff options
Diffstat (limited to 'src/gui/inputmethod/qwininputcontext_win.cpp')
-rw-r--r-- | src/gui/inputmethod/qwininputcontext_win.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp index e3e8aa4..dd966d5 100644 --- a/src/gui/inputmethod/qwininputcontext_win.cpp +++ b/src/gui/inputmethod/qwininputcontext_win.cpp @@ -59,7 +59,7 @@ #include "qdebug.h" #endif -#if defined(Q_OS_WINCE) +#if defined(Q_WS_WINCE) extern void qt_wince_show_SIP(bool show); // defined in qguifunctions_wince.cpp #endif @@ -237,7 +237,7 @@ QWinInputContext::QWinInputContext(QObject *parent) aimmpump->Start(); } -#ifndef Q_OS_WINCE +#ifndef Q_WS_WINCE QSysInfo::WinVersion ver = QSysInfo::windowsVersion(); if (ver & QSysInfo::WV_NT_based && ver >= QSysInfo::WV_VISTA) { // Since the IsValidLanguageGroup/IsValidLocale functions always return true on @@ -349,7 +349,7 @@ static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD d if(QSysInfo::WindowsVersion != QSysInfo::WV_95) { len = ImmGetCompositionStringW(himc, dwIndex, lpbuf, dBufLen); } -#if !defined(Q_OS_WINCE) +#if !defined(Q_WS_WINCE) else { len = ImmGetCompositionStringA(himc, dwIndex, lpbuf, dBufLen); if (unicode) @@ -738,7 +738,7 @@ inline void enableIme(QWidget *w, bool value) // enable ime if (defaultContext) ImmAssociateContext(w->effectiveWinId(), defaultContext); -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (qApp->autoSipEnabled()) qt_wince_show_SIP(true); #endif @@ -747,7 +747,7 @@ inline void enableIme(QWidget *w, bool value) HIMC oldimc = ImmAssociateContext(w->effectiveWinId(), 0); if (!defaultContext) defaultContext = oldimc; -#ifdef Q_OS_WINCE +#ifdef Q_WS_WINCE if (qApp->autoSipEnabled()) qt_wince_show_SIP(false); #endif @@ -755,7 +755,7 @@ inline void enableIme(QWidget *w, bool value) } -void QInputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus) +void QWinInputContext::updateImeStatus(QWidget *w, bool hasFocus) { if (!w) return; @@ -824,6 +824,15 @@ void QWinInputContext::enable(QWidget *w, bool e) void QWinInputContext::setFocusWidget(QWidget *w) { + QWidget *oldFocus = focusWidget(); + if (oldFocus == w) + return; + if (w) { + QWinInputContext::updateImeStatus(w, true); + } else { + if (oldFocus) + QWinInputContext::updateImeStatus(oldFocus , false); + } QInputContext::setFocusWidget(w); update(); } |