refact, separate remote window, add offset
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
1a8463015f
commit
902f56c499
@ -1528,10 +1528,12 @@ Future<bool> restoreWindowPosition(WindowType type,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isRemotePeerPos = false;
|
||||||
String? pos;
|
String? pos;
|
||||||
if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) {
|
if (type == WindowType.RemoteDesktop && windowId != null && peerId != null) {
|
||||||
pos = await bind.sessionGetFlutterConfigByPeerId(
|
pos = await bind.sessionGetFlutterConfigByPeerId(
|
||||||
id: peerId, k: kWindowPrefix);
|
id: peerId, k: kWindowPrefix);
|
||||||
|
isRemotePeerPos = pos != null;
|
||||||
}
|
}
|
||||||
pos ??= bind.getLocalFlutterConfig(k: kWindowPrefix + type.name);
|
pos ??= bind.getLocalFlutterConfig(k: kWindowPrefix + type.name);
|
||||||
|
|
||||||
@ -1540,6 +1542,14 @@ Future<bool> restoreWindowPosition(WindowType type,
|
|||||||
debugPrint("no window position saved, ignoring position restoration");
|
debugPrint("no window position saved, ignoring position restoration");
|
||||||
return false;
|
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) {
|
switch (type) {
|
||||||
case WindowType.Main:
|
case WindowType.Main:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user