mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 03:28:03 +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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,10 @@ class RdPlatformChannel {
|
||||
return _osxMethodChannel
|
||||
.invokeMethod("setWindowTheme", {"themeName": theme.name});
|
||||
}
|
||||
|
||||
/// Terminate .app manually.
|
||||
Future<void> terminate() {
|
||||
assert(Platform.isMacOS);
|
||||
return _osxMethodChannel.invokeMethod("terminate");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user