From 863c8de28ee9a02626403a4a2fd61ea1c6dfa1bf Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 2 Oct 2023 10:15:20 +0800 Subject: [PATCH 1/2] fix, one tap results double tap event Signed-off-by: fufesou --- flutter/lib/common/widgets/remote_input.dart | 4 +++- flutter/lib/mobile/pages/remote_page.dart | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flutter/lib/common/widgets/remote_input.dart b/flutter/lib/common/widgets/remote_input.dart index b00cd1fb4..e2bb86e43 100644 --- a/flutter/lib/common/widgets/remote_input.dart +++ b/flutter/lib/common/widgets/remote_input.dart @@ -112,7 +112,9 @@ class _RawTouchGestureDetectorRegionState if (lastDeviceKind != PointerDeviceKind.touch) { return; } - inputModel.tap(MouseButtons.left); + if (!handleTouch) { + inputModel.tap(MouseButtons.left); + } } onDoubleTapDown(TapDownDetails d) { diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index f638fb2e8..f5b6270f9 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -421,9 +421,8 @@ class _RemotePageState extends State { ); } - // to-do: Check if peer is ios. - bool get isPeerMobile => kPeerPlatformAndroid == gFFI.ffiModel.pi.platform; - bool get showCursorPaint => !isPeerMobile && !gFFI.canvasModel.cursorEmbedded; + bool get showCursorPaint => + !gFFI.ffiModel.isPeerAndroid && !gFFI.canvasModel.cursorEmbedded; Widget getBodyForMobile() { final keyboardIsVisible = keyboardVisibilityController.isVisible; From 315a2a695fd383e16e677e00685fca9b3f833854 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 2 Oct 2023 12:17:11 +0800 Subject: [PATCH 2/2] add comments Signed-off-by: fufesou --- flutter/lib/common/widgets/remote_input.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter/lib/common/widgets/remote_input.dart b/flutter/lib/common/widgets/remote_input.dart index e2bb86e43..a07bffa47 100644 --- a/flutter/lib/common/widgets/remote_input.dart +++ b/flutter/lib/common/widgets/remote_input.dart @@ -93,6 +93,7 @@ class _RawTouchGestureDetectorRegionState return; } if (handleTouch) { + // Desktop or mobile "Touch mode" ffi.cursorModel.move(d.localPosition.dx, d.localPosition.dy); inputModel.tapDown(MouseButtons.left); } @@ -113,6 +114,7 @@ class _RawTouchGestureDetectorRegionState return; } if (!handleTouch) { + // Mobile, "Mouse mode" inputModel.tap(MouseButtons.left); } }