Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

Revert "fix(iPad): keep touch gestures with external mouse (#14652)" (#15288)

RustDesk1fc33218dc8e
diff --git a/flutter/lib/common/widgets/remote_input.dart b/flutter/lib/common/widgets/remote_input.dart
index 9515ca759..5871033db 100644
--- a/flutter/lib/common/widgets/remote_input.dart
+++ b/flutter/lib/common/widgets/remote_input.dart
@@ -532,9 +532,7 @@ class _RawTouchGestureDetectorRegionState
// Official
TapGestureRecognizer:
GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
- () => TapGestureRecognizer(
- supportedDevices: kTouchBasedDeviceKinds,
- ), (instance) {
+ () => TapGestureRecognizer(), (instance) {
instance
..onTapDown = onTapDown
..onTapUp = onTapUp
@@ -542,18 +540,14 @@ class _RawTouchGestureDetectorRegionState
}),
DoubleTapGestureRecognizer:
GestureRecognizerFactoryWithHandlers<DoubleTapGestureRecognizer>(
- () => DoubleTapGestureRecognizer(
- supportedDevices: kTouchBasedDeviceKinds,
- ), (instance) {
+ () => DoubleTapGestureRecognizer(), (instance) {
instance
..onDoubleTapDown = onDoubleTapDown
..onDoubleTap = onDoubleTap;
}),
LongPressGestureRecognizer:
GestureRecognizerFactoryWithHandlers<LongPressGestureRecognizer>(
- () => LongPressGestureRecognizer(
- supportedDevices: kTouchBasedDeviceKinds,
- ), (instance) {
+ () => LongPressGestureRecognizer(), (instance) {
instance
..onLongPressDown = onLongPressDown
..onLongPressUp = onLongPressUp
@@ -563,9 +557,7 @@ class _RawTouchGestureDetectorRegionState
// Customized
HoldTapMoveGestureRecognizer:
GestureRecognizerFactoryWithHandlers<HoldTapMoveGestureRecognizer>(
- () => HoldTapMoveGestureRecognizer(
- supportedDevices: kTouchBasedDeviceKinds,
- ),
+ () => HoldTapMoveGestureRecognizer(),
(instance) => instance
..onHoldDragStart = onHoldDragStart
..onHoldDragUpdate = onHoldDragUpdate
@@ -573,18 +565,14 @@ class _RawTouchGestureDetectorRegionState
..onHoldDragEnd = onHoldDragEnd),
DoubleFinerTapGestureRecognizer:
GestureRecognizerFactoryWithHandlers<DoubleFinerTapGestureRecognizer>(
- () => DoubleFinerTapGestureRecognizer(
- supportedDevices: kTouchBasedDeviceKinds,
- ), (instance) {
+ () => DoubleFinerTapGestureRecognizer(), (instance) {
instance
..onDoubleFinerTap = onDoubleFinerTap
..onDoubleFinerTapDown = onDoubleFinerTapDown;
}),
CustomTouchGestureRecognizer:
GestureRecognizerFactoryWithHandlers<CustomTouchGestureRecognizer>(
- () => CustomTouchGestureRecognizer(
- supportedDevices: kTouchBasedDeviceKinds,
- ), (instance) {
+ () => CustomTouchGestureRecognizer(), (instance) {
instance.onOneFingerPanStart =
(DragStartDetails d) => onOneFingerPanStart(context, d);
instance
diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart
index c3bff5d63..6f3831072 100644
--- a/flutter/lib/mobile/pages/remote_page.dart
+++ b/flutter/lib/mobile/pages/remote_page.dart
@@ -517,10 +517,12 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
}
return Container(
color: MyTheme.canvasColor,
- child: RawTouchGestureDetectorRegion(
- child: getBodyForMobile(),
- ffi: gFFI,
- ),
+ child: inputModel.isPhysicalMouse.value
+ ? getBodyForMobile()
+ : RawTouchGestureDetectorRegion(
+ child: getBodyForMobile(),
+ ffi: gFFI,
+ ),
);
}),
),
diff --git a/flutter/lib/mobile/pages/view_camera_page.dart b/flutter/lib/mobile/pages/view_camera_page.dart
index 08c8cda1a..0898125c4 100644
--- a/flutter/lib/mobile/pages/view_camera_page.dart
+++ b/flutter/lib/mobile/pages/view_camera_page.dart
@@ -259,11 +259,13 @@ class _ViewCameraPageState extends State<ViewCameraPage>
}
return Container(
color: MyTheme.canvasColor,
- child: RawTouchGestureDetectorRegion(
- child: getBodyForMobile(),
- ffi: gFFI,
- isCamera: true,
- ),
+ child: inputModel.isPhysicalMouse.value
+ ? getBodyForMobile()
+ : RawTouchGestureDetectorRegion(
+ child: getBodyForMobile(),
+ ffi: gFFI,
+ isCamera: true,
+ ),
);
}),
),