diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-03-29 17:33:47 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-04-06 19:25:22 +0000 |
commit | 19eaf9f0e5d6fbf4aa6910e8148a0b8985b2500b (patch) | |
tree | a862c80d7c8471bf9ddac7dcd167ab3cf30c3b40 | |
parent | 9f4ef17852623ac4f09c0443d0d74f84738355b8 (diff) | |
download | qtlocation-19eaf9f0e5d6fbf4aa6910e8148a0b8985b2500b.tar.gz |
Allow zoom/pan/tilt with mouse on Wayland
This is redundant when you're using a touchpad that can provide the
pinch-zoom feature; but so far we are not distinguishing mice and
touchpads on Wayland. So in case the device that claims to be a touchpad
is actually just a mouse, the user needs some way to zoom, pan and tilt.
This can be reverted when QTBUG-112432 is fixed.
Task-number: QTBUG-112394
Task-number: QTBUG-112432
Change-Id: Ie339e3c1d7d0b1d5b6383d8e7f8fd1cdcb462db6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fbe6f3f4b9456467baa772c6efe40b80aefd1414)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | examples/location/minimal_map/main.qml | 5 | ||||
-rw-r--r-- | src/location/maps/MapView.qml | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/location/minimal_map/main.qml b/examples/location/minimal_map/main.qml index 7093ceb6..70f30d5a 100644 --- a/examples/location/minimal_map/main.qml +++ b/examples/location/minimal_map/main.qml @@ -43,9 +43,10 @@ Window { } WheelHandler { id: wheel - // workaround for QTBUG-87646 / QTBUG-112394: + // workaround for QTBUG-87646 / QTBUG-112394 / QTBUG-112432: // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler - acceptedDevices: Qt.platform.pluginName === "cocoa" + // and we don't yet distinguish mice and trackpads on Wayland either + acceptedDevices: Qt.platform.pluginName === "cocoa" || Qt.platform.pluginName === "wayland" ? PointerDevice.Mouse | PointerDevice.TouchPad : PointerDevice.Mouse rotationScale: 1/120 diff --git a/src/location/maps/MapView.qml b/src/location/maps/MapView.qml index 70d2105e..5ee96f63 100644 --- a/src/location/maps/MapView.qml +++ b/src/location/maps/MapView.qml @@ -103,9 +103,10 @@ Item { } WheelHandler { id: wheel - // workaround for QTBUG-87646 / QTBUG-112394: + // workaround for QTBUG-87646 / QTBUG-112394 / QTBUG-112432: // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler - acceptedDevices: Qt.platform.pluginName === "cocoa" + // and we don't yet distinguish mice and trackpads on Wayland either + acceptedDevices: Qt.platform.pluginName === "cocoa" || Qt.platform.pluginName === "wayland" ? PointerDevice.Mouse | PointerDevice.TouchPad : PointerDevice.Mouse onWheel: (event) => { |