diff options
author | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-06-17 13:50:16 (GMT) |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@digia.com> | 2009-06-17 13:50:16 (GMT) |
commit | 75140c4776934744c37a34b10b7d4b8665aa4dc1 (patch) | |
tree | 76c8af81bf6987a58dbb996ebb18d2b33937a577 /src/gui/kernel | |
parent | 2ede08bce669ddb68070ec1344a51b97ddc945d2 (diff) | |
download | Qt-75140c4776934744c37a34b10b7d4b8665aa4dc1.zip Qt-75140c4776934744c37a34b10b7d4b8665aa4dc1.tar.gz Qt-75140c4776934744c37a34b10b7d4b8665aa4dc1.tar.bz2 |
longtap event gets properly cancelled when entering popup
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 4c008fb..9a2bbe6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -343,7 +343,7 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos, Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); sendMouseEvent(alienWidget, &mEvent); - m_previousEventLongTap = false; + m_previousEventLongTap = true; } void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) @@ -821,18 +821,21 @@ void QApplicationPrivate::openPopup(QWidget *popup) WId id = popup->effectiveWinId(); id->SetPointerCapture(true); id->SetGloballyCapturing(true); - autoGrabWindow = id; } // popups are not focus-handled by the window system (the first // popup grabbed the keyboard), so we have to do that manually: A // new popup gets the focus - if (popup->focusWidget()) { - popup->focusWidget()->setFocus(Qt::PopupFocusReason); + if (QApplication::focusWidget()) + static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); + QWidget *fw = popup->focusWidget(); + if (fw) { + fw->setFocus(Qt::PopupFocusReason); } else if (QApplicationPrivate::popupWidgets->count() == 1) { // this was the first popup - if (QWidget *fw = QApplication::focusWidget()) { - static_cast<QSymbianControl*>(fw->effectiveWinId())->CancelLongTapTimer(); + fw = QApplication::focusWidget(); + if (fw) { +// static_cast<QSymbianControl*>(fw->effectiveWinId())->CancelLongTapTimer(); QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); q_func()->sendEvent(fw, &e); } |