1 Commits

Author SHA1 Message Date
rustdesk
4423e0a1dc 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.
2025-11-19 00:31:38 +08:00

View File

@@ -810,6 +810,10 @@ class InputModel {
} }
Future<void> tapDown(MouseButtons button) async { Future<void> tapDown(MouseButtons button) async {
if (!_pointerMovedAfterEnter) {
refreshMousePos();
await Future.delayed(Duration(milliseconds: 10));
}
await sendMouse('down', button); await sendMouse('down', button);
} }