From 8a37a69c961092aae7dd7f55f30a15b3fae1b7cc Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 14 Apr 2011 13:22:36 +0300 Subject: Splitview flag should also be updated to inputcontext Currently splitview support is defined in exported global private method. There is no guarantee that input context is created, or updated when the API is called. This is problematic, since the client need to find a correct place and time when to call the API. As a change, update existing input context when the API is called. Also, take into account the splitview flag when updating input context. This ensures that client can enforce the flag use correctly. Task-number: QTBUG-18715 Reviewed-by: Guoqing Zhang --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index e4b965b..c11d5e8 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -77,6 +77,15 @@ QT_BEGIN_NAMESPACE Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable) { S60->partial_keyboard = enable; + + QInputContext *ic = 0; + if (QApplication::focusWidget()) { + ic = QApplication::focusWidget()->inputContext(); + } else if (qApp && qApp->inputContext()) { + ic = qApp->inputContext(); + } + if (ic) + ic->update(); } QCoeFepInputContext::QCoeFepInputContext(QObject *parent) @@ -580,6 +589,19 @@ void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities) QWidget *w = focusWidget(); if (w) { Qt::InputMethodHints hints = w->inputMethodHints(); + + // Since splitview support works like an input method hint, yet it is private flag, + // we need to update its state separately. + if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) { + TInt currentFlags = m_fepState->Flags(); + if (S60->partial_keyboard) + currentFlags |= QT_EAknEditorFlagEnablePartialScreen; + else + currentFlags &= ~QT_EAknEditorFlagEnablePartialScreen; + if (currentFlags != m_fepState->Flags()) + m_fepState->SetFlags(currentFlags); + } + if (hints != m_lastImHints) { m_lastImHints = hints; applyHints(hints); -- cgit v0.12