aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquicktaphandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-12-04 12:27:23 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-12-10 10:06:53 +0000
commitf8f0f0835a971a658f4ee2ae386e448338b1a7d7 (patch)
treee3c84916a2b5e8f5e1f19c8dd5034e5487dd9b7a /src/quick/handlers/qquicktaphandler.cpp
parentecec3d45ece7f0754f2bdede3aaadb13ab71e3c4 (diff)
TapHandler: ignore scroll events and native gestures
During a 2-finger press (to emulate right click on a trackpad), the OS may also generate a QWheelEvent with ScrollBegin phase just in case scrolling starts. This must not prematurely deactivate the TapHandler. Also if a gesture or wheel event begins as the very first event after an application starts, ensure that subsequent mouse events are not mis-delivered as wheel or gesture events. Fixes: QTBUG-71955 Change-Id: Ic12e116483ab9ad37c4ac3b1d10ccb62e1349e0a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquicktaphandler.cpp')
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index e97722d6b7..d480d3b491 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -107,6 +107,10 @@ static bool dragOverThreshold(const QQuickEventPoint *point)
bool QQuickTapHandler::wantsEventPoint(QQuickEventPoint *point)
{
+ if (!point->pointerEvent()->asPointerMouseEvent() &&
+ !point->pointerEvent()->asPointerTouchEvent() &&
+ !point->pointerEvent()->asPointerTabletEvent() )
+ return false;
// If the user has not violated any constraint, it could be a tap.
// Otherwise we want to give up the grab so that a competing handler
// (e.g. DragHandler) gets a chance to take over.