refact, tab to window, remove rust cache data

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-08-14 20:40:58 +08:00
parent e205577145
commit fad88c2718
15 changed files with 100 additions and 156 deletions

View File

@@ -54,12 +54,10 @@ class RustDeskMultiWindowManager {
var params = {
'type': WindowType.RemoteDesktop.index,
'id': peerId,
'tab_window_id': windowId,
'session_id': sessionId,
};
// It's better to use the window id that returned by _newSession.
// Do not pass original window id to _newSession,
// as this function cann't promise the necessary data is passed to new window.
final multiWindowRes = await _newSession(
await _newSession(
false,
WindowType.RemoteDesktop,
kWindowEventNewRemoteDesktop,
@@ -67,12 +65,6 @@ class RustDeskMultiWindowManager {
_remoteDesktopWindows,
jsonEncode(params),
);
// kWindowEventCloseForSeparateWindow will not only close the tab, but also pass the required data to new window.
await DesktopMultiWindow.invokeMethod(
windowId, kWindowEventCloseForSeparateWindow, {
'peerId': peerId,
'newWindowId': multiWindowRes.windowId,
});
}
Future<int> newSessionWindow(