Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix(flutter): restore multi-window rendering after reconnect (#16383)

fufesou0c18a8cbc9c9
diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart
index 6653dddf8..f1abb8e36 100644
--- a/flutter/lib/models/model.dart
+++ b/flutter/lib/models/model.dart
@@ -1427,9 +1427,9 @@ class FfiModel with ChangeNotifier {
}
// After reconnecting, restore the last selected monitor once the canvas is ready.
// Switching earlier can offset the view if the monitor sizes differ.
- final last = lastUserDisplay;
+ // New monitor windows keep their selection in currentDisplay.
+ final last = lastUserDisplay ?? _pi.currentDisplay;
pendingMonitorRestore = (!isCache &&
- last != null &&
last != currentDisplay &&
bind.sessionGetUseAllMyDisplaysForTheRemoteSession(
sessionId: sessionId) !=