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; }())); }