mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-07-06 07:56:46 +08:00
cf1de4de62
* Feature: Restore the last viewed monitor on auto reconnect Remembers the users last manually selected remote monitor and returns to it after an auto reconnect. In memory, reconnect only, and bounds checked against the current display count. It is skipped in "use all my displays" mode. Signed-off-by: StealUrKill <35749471+StealUrKill@users.noreply.github.com> * Address review on reconnect monitor restore Avoid a crash if the session closes during a reconnect. Don't overwrite the remembered monitor on auto restore. Defer the switch until the view is ready so a monitor with a different size renders correctly. Signed-off-by: StealUrKill <35749471+StealUrKill@users.noreply.github.com> * Guard all-displays reconnect restore against empty display list * Harden reconnect monitor restore against races and multi-UI sessions Cancel a queued restore when the user manually selects a monitor, so a newer choice is not overridden by a stale pending restore. Compare the remembered monitor against the reconnect event's display instead of the stale _pi.currentDisplay, which is intentionally left unchanged when the peer has multiple sessions. Add a frame-independent fallback so a multi-UI tab that never receives the first-image event (its display is filtered to the owning tab) still restores the remembered monitor. Signed-off-by: StealUrKill <35749471+StealUrKill@users.noreply.github.com> * Harden reconnect monitor restore: fallback timer, lifecycle, cursor Follow-up hardening on the auto-reconnect monitor restore: - Cancel the fallback timer synchronously once this tab owns the restore, so it can no longer fire while onEvent2UIRgba is awaiting canvas setup and switch displays before the canvas is ready (the offset the deferred restore exists to avoid). The multi-UI no-frame fallback stays intact. - Apply the restore in a finally so a throwing canvas init still runs it instead of stranding a queued restore with the timer already cancelled. - Cancel the fallback timer on a manual monitor switch, so a newer user selection supersedes a queued restore instead of racing it. - Restore with updateCursorPos: false, matching other programmatic display switches so an auto-restore does not reposition the cursor. --------- Signed-off-by: StealUrKill <35749471+StealUrKill@users.noreply.github.com>