From 56a8f6b97b7508fa38f05fe188c3969961288ca2 Mon Sep 17 00:00:00 2001 From: fufesou <13586388+fufesou@users.noreply.github.com> Date: Wed, 28 Jan 2026 15:11:44 +0800 Subject: [PATCH] fix(iOS): Unexpected mouse movement to (0,0) on idle (#14180) Signed-off-by: fufesou --- flutter/lib/models/input_model.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flutter/lib/models/input_model.dart b/flutter/lib/models/input_model.dart index c14a23739..0eb74dbc5 100644 --- a/flutter/lib/models/input_model.dart +++ b/flutter/lib/models/input_model.dart @@ -1048,6 +1048,14 @@ class InputModel { if (isViewOnly && !showMyCursor) return; if (e.kind != ui.PointerDeviceKind.mouse) return; + // May fix https://github.com/rustdesk/rustdesk/issues/13009 + if (isIOS && e.synthesized && e.position == Offset.zero && e.buttons == 0) { + // iOS may emit a synthesized hover event at (0,0) when the mouse is disconnected. + // Ignore this event to prevent cursor jumping. + debugPrint('Ignored synthesized hover at (0,0) on iOS'); + return; + } + // Only update pointer region when relative mouse mode is enabled. // This avoids unnecessary tracking when not in relative mode. if (_relativeMouse.enabled.value) {