summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 92d3359909..8d0a51606e 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2867,16 +2867,19 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
case QEvent::NetworkReplyUpdated:
break;
default:
- if (receiver->isWidgetType()) {
- if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
- return true;
- } else {
- // a special case for events that go to QGesture objects.
- // We pass the object to the gesture manager and it'll figure
- // out if it's QGesture or not.
- if (d->gestureManager->filterEvent(receiver, e))
- return true;
+ if (d->gestureManager->thread() == QThread::currentThread()) {
+ if (receiver->isWidgetType()) {
+ if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
+ return true;
+ } else {
+ // a special case for events that go to QGesture objects.
+ // We pass the object to the gesture manager and it'll figure
+ // out if it's QGesture or not.
+ if (d->gestureManager->filterEvent(receiver, e))
+ return true;
+ }
}
+ break;
}
}
#endif // QT_NO_GESTURES
@@ -3976,7 +3979,11 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window,
break;
}
default:
- if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)) {
+ if (widget->testAttribute(Qt::WA_WState_AcceptedTouchBeginEvent)
+#ifndef QT_NO_GESTURES
+ || QGestureManager::gesturePending(widget)
+#endif
+ ) {
if (touchEvent.type() == QEvent::TouchEnd)
widget->setAttribute(Qt::WA_WState_AcceptedTouchBeginEvent, false);
if (QApplication::sendSpontaneousEvent(widget, &touchEvent) && touchEvent.isAccepted())