fix, reuse window type

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow 2023-08-06 16:47:41 +08:00
parent d02dc1797c
commit 3edba4e2db

View File

@ -90,22 +90,21 @@ class RustDeskMultiWindowManager {
) async { ) async {
if (separateWindow) { if (separateWindow) {
if (kCloseMultiWindowByHide && _inactiveWindows.isNotEmpty) { if (kCloseMultiWindowByHide && _inactiveWindows.isNotEmpty) {
final windowId = _inactiveWindows.first; for (final windowId in windows) {
final invokeRes = if (_inactiveWindows.contains(windowId)) {
await DesktopMultiWindow.invokeMethod(windowId, methodName, msg); await DesktopMultiWindow.invokeMethod(
final windowController = WindowController.fromWindowId(windowId); windowId, methodName, msg);
windowController.show(); WindowController.fromWindowId(windowId).show();
registerActiveWindow(windowController.windowId); registerActiveWindow(windowId);
windows.add(windowController.windowId); }
return invokeRes; }
} else {
await newSessionWindow(type, remoteId, msg, windows);
} }
await newSessionWindow(type, remoteId, msg, windows);
} else { } else {
if (windows.isEmpty) { if (windows.isEmpty) {
await newSessionWindow(type, remoteId, msg, windows); await newSessionWindow(type, remoteId, msg, windows);
} else { } else {
return call(type, methodName, msg); call(type, methodName, msg);
} }
} }
} }