From 4423e0a1dc9f12e852de6a2d4f942d255edfb028 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 19 Nov 2025 00:31:38 +0800 Subject: [PATCH] Fix mouse hover issue on menu bar when controlling Mac from iPad Fixes #8789 The issue was that when using the virtual/floating mouse on mobile devices to control a Mac, mouse clicks would occur at the wrong position, particularly noticeable in the menu bar where hover menus would disappear immediately. Root cause: The tapDown() method was sending mouse button events without ensuring the cursor position was updated on the server side first. This caused clicks to register at stale cursor positions. Solution: Before sending a mouse down event, check if the pointer has moved since entering the session. If not, send a mouse move event first to update the cursor position, then wait briefly before sending the click event. This ensures the remote cursor is at the correct position before any mouse button action is performed. --- flutter/lib/models/input_model.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flutter/lib/models/input_model.dart b/flutter/lib/models/input_model.dart index 29d0cc0fd..8a3e60779 100644 --- a/flutter/lib/models/input_model.dart +++ b/flutter/lib/models/input_model.dart @@ -810,6 +810,10 @@ class InputModel { } Future tapDown(MouseButtons button) async { + if (!_pointerMovedAfterEnter) { + refreshMousePos(); + await Future.delayed(Duration(milliseconds: 10)); + } await sendMouse('down', button); }