mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
fix: --connect command on macOS & window closing issues
This commit is contained in:
@@ -160,6 +160,24 @@ class RustDeskMultiWindowManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
void clearWindowType(WindowType type) {
|
||||
switch (type) {
|
||||
case WindowType.Main:
|
||||
return;
|
||||
case WindowType.RemoteDesktop:
|
||||
_remoteDesktopWindowId = null;
|
||||
break;
|
||||
case WindowType.FileTransfer:
|
||||
_fileTransferWindowId = null;
|
||||
break;
|
||||
case WindowType.PortForward:
|
||||
_portForwardWindowId = null;
|
||||
break;
|
||||
case WindowType.Unknown:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void setMethodHandler(
|
||||
Future<dynamic> Function(MethodCall call, int fromWindowId)? handler) {
|
||||
DesktopMultiWindow.setMethodHandler(handler);
|
||||
@@ -186,8 +204,11 @@ class RustDeskMultiWindowManager {
|
||||
}
|
||||
await WindowController.fromWindowId(wId).setPreventClose(false);
|
||||
await WindowController.fromWindowId(wId).close();
|
||||
} on Error {
|
||||
} catch (e) {
|
||||
debugPrint("$e");
|
||||
return;
|
||||
} finally {
|
||||
clearWindowType(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user