diff options
| author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-02-01 16:51:42 +0100 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-02-21 07:02:19 +0100 |
| commit | 7ef3bee4f275736abb716505a93cdc5ddadff36b (patch) | |
| tree | b71882c69331f02072dc7dfa5b296867c8f87e77 /src/quick/handlers/qquickpointerdevicehandler.cpp | |
| parent | 955eb5c401c9aa195a1f37d395bbf08192206e50 (diff) | |
TapHandler: ignore untracked moving points; treat touchpad as mouse
TapHandler must decide on press whether it's interested in tracking a
particular point further, to see if a qualifying tap occurs, and should
only care about those points it decided to track. But if it did not
decide to track it, wantsEventPoint() should never care about the point
movement after press; nor about hovering points either.
The line in QQuickPointerDeviceHandler::wantsPointerEvent() checking
pointingDevice()->pointerType() != Finger was also making touchpad
behavior inconsistent with mouse behavior, which is why this bug
appeared on macOS but not on Linux: QQuickPointerDeviceHandler needs
to care about the incoming event's buttons on all devices except
touchscreens. It's probably been causing other symptoms on touchpads
since a97760a336c597327cb82eebc9f45c793aec32c9.
For the test, a05cbaaae505dba2546c593e22fe2f9047c0de4b restored the
cumulative native gesture scaling as it should be: so if we try to
scale by 1.1 twice in a row, the result is it's scaled by 1.21.
Pick-to: 6.2 6.4 6.5
Fixes: QTBUG-108896
Change-Id: I3da8878648b89cce5d1a48fa02dffaefead2ac90
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickpointerdevicehandler.cpp')
| -rw-r--r-- | src/quick/handlers/qquickpointerdevicehandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/handlers/qquickpointerdevicehandler.cpp b/src/quick/handlers/qquickpointerdevicehandler.cpp index b610e083cc..2d2ef44a81 100644 --- a/src/quick/handlers/qquickpointerdevicehandler.cpp +++ b/src/quick/handlers/qquickpointerdevicehandler.cpp @@ -270,7 +270,7 @@ bool QQuickPointerDeviceHandler::wantsPointerEvent(QPointerEvent *event) if (d->acceptedModifiers != Qt::KeyboardModifierMask && event->modifiers() != d->acceptedModifiers) return false; // Some handlers (HoverHandler, PinchHandler) set acceptedButtons to Qt::NoButton to indicate that button state is irrelevant. - if (event->pointingDevice()->pointerType() != QPointingDevice::PointerType::Finger && + if (event->pointingDevice()->type() != QPointingDevice::DeviceType::TouchScreen && acceptedButtons() != Qt::NoButton && event->type() != QEvent::Wheel && (static_cast<QSinglePointEvent *>(event)->buttons() & acceptedButtons()) == 0 && (static_cast<QSinglePointEvent *>(event)->button() & acceptedButtons()) == 0) |
