From f6ff4a7108586f8deace9ca2ffffcaa4c8d41036 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Fri, 4 Dec 2026 12:20:52 +0800 Subject: [PATCH] fix(mobile): keep the mouse-mode virtual mouse inside the canvas gesture region Holding a virtual left/right button while another finger drags relies on the canvas recognizer seeing both pointers: it then takes the isSpecialHoldDragActive branch of onTwoFingerScaleUpdate. With the virtual mouse moved above the key bar and out of the region, the recognizer saw only the dragging finger, routed it through onOneFingerPanUpdate, and any movement of the holding finger set blockEvents and froze the drag while the remote button stayed down. Put FloatingMouseWidgets back where master has it; the cursor and the touch-mode virtual mouse stay above the bar. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01JAxkkig1bcC5Xrr1uwX47b --- flutter/lib/mobile/pages/remote_page.dart | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index a2638119f..9f9cd8ad6 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -715,7 +715,8 @@ class _RemotePageState extends State with WidgetsBindingObserver { // The key bar sits above the canvas, outside its gesture region: a touch on the bar must not // also reach the canvas recognizers, which would send it to the remote as a mouse event. - // The cursor and the virtual mouse stay above the bar, as they were inside the canvas stack. + // The cursor and the touch-mode virtual mouse stay above the bar, as they were inside the canvas + // stack. The mouse-mode virtual mouse stays inside the region: see getBodyForMobile. Widget withKeyHelpTools(Widget body) => Stack(children: [ Positioned.fill(child: body), Obx(() { @@ -730,10 +731,6 @@ class _RemotePageState extends State with WidgetsBindingObserver { if (gFFI.ffiModel.touchMode) FloatingMouse( ffi: gFFI, - ) - else - FloatingMouseWidgets( - ffi: gFFI, ), ]); @@ -779,6 +776,13 @@ class _RemotePageState extends State with WidgetsBindingObserver { ).workaroundFreezeLinuxMint(), ), ]; + // Holding a virtual button while another finger drags needs both pointers in the canvas + // recognizers (isSpecialHoldDragActive), so these stay inside the gesture region. + if (!gFFI.ffiModel.touchMode) { + paints.add(FloatingMouseWidgets( + ffi: gFFI, + )); + } return paints; }())); }