diff options
author | axis <qt-info@nokia.com> | 2009-04-08 13:29:07 +0200 |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-05-04 15:24:28 +0200 |
commit | 23972064c554163e4bdb6de0fe6eaa0d41a6ad6a (patch) | |
tree | aa4beaa8f9901c7b3567fb72f794dd91a5c1ceb2 /src/gui/inputmethod/qcoefepinputcontext_s60.cpp | |
parent | 0bc0c1c9b09cda459dbfdc16cb4089297160ce85 (diff) |
Made the S60 FEP use the new RequestSoftwareInputPanel events.
RevBy: Trustme
Diffstat (limited to 'src/gui/inputmethod/qcoefepinputcontext_s60.cpp')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index b9ea4c722b..5bf4259571 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -208,39 +208,26 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) return false; } - if (event->type() == QEvent::MouseButtonPress) { - const QMouseEvent *mEvent = static_cast<const QMouseEvent *>(event); - m_mousePressPos = mEvent->globalPos(); - } else if (event->type() == QEvent::MouseButtonRelease) { + if (event->type() == QEvent::RequestSoftwareInputPanel) { // Notify S60 that we want the virtual keyboard to show up. - const QMouseEvent *mEvent = static_cast<const QMouseEvent *>(event); - - if (mEvent->modifiers() == Qt::NoModifier - && mEvent->button() == Qt::LeftButton - && focusWidget() // Not set if prior MouseButtonPress was not on this widget - && focusWidget()->rect().contains(focusWidget()->mapFromGlobal(mEvent->globalPos())) - && (m_mousePressPos - mEvent->globalPos()).manhattanLength() < QApplication::startDragDistance()) { - - QSymbianControl *sControl; - sControl = focusWidget()->effectiveWinId()->MopGetObject(sControl); - // The FEP UI temporarily steals focus when it shows up the first time, causing - // all sorts of weird effects on the focused widgets. Since it will immediately give - // back focus to us, we temporarily disable focus handling until the job's done. - if (sControl) { - sControl->setIgnoreFocusChanged(true); - } - - m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::QT_EAknActivatePenInputRequest); - - if (sControl) { - sControl->setIgnoreFocusChanged(false); - } - - // Although it is tempting to let the click through by returning false, we have to return - // true because the event might have caused focus switches, which may in turn delete - // widgets. - return true; + QSymbianControl *sControl; + Q_ASSERT(focusWidget()); + sControl = focusWidget()->effectiveWinId()->MopGetObject(sControl); + Q_ASSERT(sControl); + + // The FEP UI temporarily steals focus when it shows up the first time, causing + // all sorts of weird effects on the focused widgets. Since it will immediately give + // back focus to us, we temporarily disable focus handling until the job's done. + if (sControl) { + sControl->setIgnoreFocusChanged(true); + } + + m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::QT_EAknActivatePenInputRequest); + + if (sControl) { + sControl->setIgnoreFocusChanged(false); } + return true; } return false; |