diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index a9117554d..7324a8c18 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1528,10 +1528,12 @@ Future restoreWindowPosition(WindowType type, return false; } + bool isRemotePeerPos = false; String? pos; if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) { pos = await bind.sessionGetFlutterConfigByPeerId( id: peerId, k: kWindowPrefix); + isRemotePeerPos = pos != null; } pos ??= bind.getLocalFlutterConfig(k: kWindowPrefix + type.name); @@ -1540,6 +1542,14 @@ Future restoreWindowPosition(WindowType type, debugPrint("no window position saved, ignoring position restoration"); return false; } + if (type == WindowType.RemoteDesktop && !isRemotePeerPos && windowId != null) { + if (lpos.offsetWidth != null) { + lpos.offsetWidth = lpos.offsetWidth! + windowId * 20; + } + if (lpos.offsetHeight != null) { + lpos.offsetHeight = lpos.offsetHeight! + windowId * 20; + } + } switch (type) { case WindowType.Main: