aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickoverlay.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-06-29 16:37:02 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-07-04 19:21:25 +0000
commit57810c5c736f69790dd49fa1146eb70de8c95a55 (patch)
tree6d961714b70edef1f86e2cb08123b71dd752a138 /src/quicktemplates2/qquickoverlay.cpp
parent64dd82cdeaf0a6ad10e0fb57a7dabe73ea9cb77e (diff)
Fix modal overlay to block multi-touch
Task-number: QTBUG-61698 Change-Id: I46db5e9816190ac7afd6b671198dff11089bc4f3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickoverlay.cpp')
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index a4aaa60d..8de37d1c 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -210,6 +210,11 @@ bool QQuickOverlayPrivate::startDrag(QEvent *event, const QPointF &pos)
return false;
}
+static bool isTouchEvent(QEvent *event)
+{
+ return event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchUpdate || event->type() == QEvent::TouchEnd;
+}
+
bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target)
{
if (target) {
@@ -218,7 +223,7 @@ bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuick
return true;
}
return false;
- } else if (!mouseGrabberPopup) {
+ } else if (!mouseGrabberPopup || isTouchEvent(event)) {
// allow non-modal popups to close themselves,
// and non-dimming modal popups to block the event
const auto popups = stackingOrderPopups();