diff options
author | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-05-19 13:46:04 (GMT) |
---|---|---|
committer | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-05-19 13:46:04 (GMT) |
commit | 40fc74c780be1069ed6e7f8cf7e4ac3c70d4c20c (patch) | |
tree | 3f7467b1a75bb2564c4c1ca3261cf8027b96968b /src/gui/kernel/qapplication_s60.cpp | |
parent | 3cfd4e97aa8f5e8c7b9eda9d7847b3f236d3efb5 (diff) | |
parent | d7fda9c7aef17ed79fd656f197fb179acb4ec54a (diff) | |
download | Qt-40fc74c780be1069ed6e7f8cf7e4ac3c70d4c20c.zip Qt-40fc74c780be1069ed6e7f8cf7e4ac3c70d4c20c.tar.gz Qt-40fc74c780be1069ed6e7f8cf7e4ac3c70d4c20c.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into softkeys
Diffstat (limited to 'src/gui/kernel/qapplication_s60.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 8cf2f8f..db67fd8 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -305,7 +305,6 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons QWidget *alienWidget; QPoint widgetPos = QPoint(aPenEventLocation.iX, aPenEventLocation.iY); QPoint globalPos = QPoint(aPenEventScreenLocation.iX,aPenEventScreenLocation.iY); - //### possible bug, within manhattan lenght if the target is slipped outside .... alienWidget = qwidget->childAt(widgetPos); if (!alienWidget) alienWidget = qwidget; @@ -324,6 +323,7 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) QMouseEvent::Type type; Qt::MouseButton button; mapS60MouseEventTypeToQt(&type, &button, &pEvent); + if (m_previousEventLongTap) if (type == QEvent::MouseButtonRelease){ button = Qt::RightButton; @@ -371,27 +371,30 @@ void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent) button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers)); events.append(Event(S60->lastPointerEventTarget,mEventLeave)); } - QMouseEvent mEventEnter(QEvent::Enter, alienWidget->mapFrom(qwidget, widgetPos), globalPos, + QMouseEvent mEventEnter(QEvent::Enter, alienWidget->mapFromGlobal(globalPos), globalPos, button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers)); + events.append(Event(alienWidget,mEventEnter)); } S60->lastCursorPos = globalPos; S60->lastPointerEventPos = widgetPos; S60->lastPointerEventTarget = alienWidget; - - QMouseEvent mEvent(type, alienWidget->mapFrom(qwidget, widgetPos), globalPos, - button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers)); - events.append(Event(alienWidget,mEvent)); - QEventDispatcherS60 *dispatcher; - // It is theoretically possible for someone to install a different event dispatcher. - if (dispatcher = qobject_cast<QEventDispatcherS60 *>(alienWidget->d_func()->threadData->eventDispatcher)) { - if (dispatcher->excludeUserInputEvents()) { - for (int i=0;i < events.count();++i) - { - Event next = events[i]; - dispatcher->saveInputEvent(this, next.first, new QMouseEvent(next.second)); + if (alienWidget) + { + QMouseEvent mEvent(type, alienWidget->mapFromGlobal(globalPos), globalPos, + button, QApplicationPrivate::mouse_buttons, mapToQtModifiers(pEvent.iModifiers)); + events.append(Event(alienWidget,mEvent)); + QEventDispatcherS60 *dispatcher; + // It is theoretically possible for someone to install a different event dispatcher. + if (dispatcher = qobject_cast<QEventDispatcherS60 *>(alienWidget->d_func()->threadData->eventDispatcher)) { + if (dispatcher->excludeUserInputEvents()) { + for (int i=0;i < events.count();++i) + { + Event next = events[i]; + dispatcher->saveInputEvent(this, next.first, new QMouseEvent(next.second)); + } + return; } - return; } } for (int i=0;i < events.count();++i) @@ -675,6 +678,10 @@ void QSymbianControl::HandleResourceChange(int resourceType) CCoeControl::HandleResourceChange(resourceType); } +void QSymbianControl::CancelLongTapTimer() +{ + m_longTapDetector->Cancel(); +} TTypeUid::Ptr QSymbianControl::MopSupplyObject(TTypeUid id) { @@ -789,6 +796,7 @@ void QApplicationPrivate::openPopup(QWidget *popup) Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created)); WId id = popup->effectiveWinId(); id->SetPointerCapture(true); + id->SetGloballyCapturing(true); autoGrabWindow = id; } @@ -800,6 +808,7 @@ void QApplicationPrivate::openPopup(QWidget *popup) popup->focusWidget()->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(); QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason); q_func()->sendEvent(fw, &e); } @@ -819,6 +828,7 @@ void QApplicationPrivate::closePopup(QWidget *popup) Q_ASSERT(popup->testAttribute(Qt::WA_WState_Created)); WId id = popup->effectiveWinId(); id->SetPointerCapture(false); + id->SetGloballyCapturing(false); if (QWidgetPrivate::mouseGrabber != 0) QWidgetPrivate::mouseGrabber->grabMouse(); |