mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-13 11:35:56 +00:00
@@ -28,7 +28,7 @@ import '../widgets/tabbar_widget.dart';
|
||||
|
||||
final SimpleWrapper<bool> _firstEnterImage = SimpleWrapper(false);
|
||||
|
||||
final Map<String, bool> noCloseSessionOnDispose = {};
|
||||
final Map<String, bool> closeSessionOnDispose = {};
|
||||
|
||||
class RemotePage extends StatefulWidget {
|
||||
RemotePage({
|
||||
@@ -203,7 +203,7 @@ class _RemotePageState extends State<RemotePage>
|
||||
|
||||
@override
|
||||
Future<void> dispose() async {
|
||||
final closeSession = noCloseSessionOnDispose.remove(widget.id) ?? false;
|
||||
final closeSession = closeSessionOnDispose.remove(widget.id) ?? true;
|
||||
|
||||
// https://github.com/flutter/flutter/issues/64935
|
||||
super.dispose();
|
||||
|
||||
@@ -147,7 +147,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
.join(';');
|
||||
} else if (call.method == kWindowEventCloseForSeparateWindow) {
|
||||
final peerId = call.arguments;
|
||||
noCloseSessionOnDispose[peerId] = true;
|
||||
closeSessionOnDispose[peerId] = false;
|
||||
tabController.closeBy(peerId);
|
||||
}
|
||||
_update_remote_count();
|
||||
|
||||
@@ -1702,6 +1702,10 @@ class FFI {
|
||||
});
|
||||
// every instance will bind a stream
|
||||
this.id = id;
|
||||
|
||||
if (isSessionAdded) {
|
||||
bind.sessionHandlePeerInfo(sessionId: sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
/// Login with [password], choose if the client should [remember] it.
|
||||
|
||||
@@ -44,7 +44,7 @@ class RustDeskMultiWindowManager {
|
||||
final List<int> _portForwardWindows = List.empty(growable: true);
|
||||
|
||||
separateWindows() async {
|
||||
for (final windowId in _remoteDesktopWindows) {
|
||||
for (final windowId in _remoteDesktopWindows.toList()) {
|
||||
final String sessionIdList = await DesktopMultiWindow.invokeMethod(
|
||||
windowId, kWindowEventGetSessionIdList, null);
|
||||
final idList = sessionIdList.split(';');
|
||||
@@ -56,7 +56,7 @@ class RustDeskMultiWindowManager {
|
||||
var params = {
|
||||
'type': WindowType.RemoteDesktop.index,
|
||||
'id': peerSession[0],
|
||||
'sessionId': peerSession[1],
|
||||
'session_id': peerSession[1],
|
||||
};
|
||||
await _newSession(
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user