Fix: Align macOS mouse coordinates with the captured display

The macOS client derived its logical screen size from [NSScreen mainScreen]
while it captured CGMainDisplayID. In clamshell mode with an external display
the former can still report the disabled built-in panel (1470x956) while the
captured frame is 1280x1024, so every injected point was scaled by
logical/encode and drifted linearly with the distance from the top left
corner, independently on each axis. Take the logical size from
CGDisplayBounds of the captured display instead, and report the same bounds
in the login resolution.

For hosts that still run the old client, the remote desktop dialog gains a
per-host mouse calibration in its system menu. The factors are stored by
client ID together with the reported resolution and the captured frame size,
so they stop applying once the client is upgraded or a different display is
captured, and come back automatically when the original display returns.
When no calibration has been saved the dialog pre-fills the factors from
frame/reported, but only for macOS clients, because the other clients derive
their conversion from the captured display itself and a mismatching report
there would be misleading.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-10-22 11:33:39 +02:00
1 parent 38cd207f5d
commit 3ae6298746
7 files changed
+250 -12

No files matched your search

+9
View File
@@ -2104,3 +2104,12 @@ V2
(已过期,续期从今天起算)= (abgelaufen; Verlaengerung ab heute)
(原授权已过期,续期从今天起算)=(Urspruengliche Lizenz abgelaufen; Verlaengerung ab heute)
子目录=SubDir
; Mouse coordinate calibration (per-host click offset workaround)
鼠标坐标校准(&M)=Mauskoordinaten-Kalibrierung(&M)
鼠标坐标校准=Mauskoordinaten-Kalibrierung
X 轴缩放系数=Skalierungsfaktor X-Achse
Y 轴缩放系数=Skalierungsfaktor Y-Achse
画面 %dx%d;上报 %s;系数为真实除以上报=Bild %dx%d; gemeldet %s; Faktor: echt/gemeldet
缩放系数需在 0.2 到 5.0 之间。=Skalierungsfaktoren muessen zwischen 0.2 und 5.0 liegen.
已按 画面/上报 自动填写,可修改=Automatisch aus Bild/Meldung; aenderbar