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

@@ -35,6 +35,7 @@ class RemotePage extends StatefulWidget {
Key? key,
required this.id,
required this.sessionId,
required this.tabWindowId,
required this.password,
required this.toolbarState,
required this.tabController,
@@ -44,6 +45,7 @@ class RemotePage extends StatefulWidget {
final String id;
final SessionID? sessionId;
final int? tabWindowId;
final String? password;
final ToolbarState toolbarState;
final String? switchUuid;
@@ -106,6 +108,7 @@ class _RemotePageState extends State<RemotePage>
password: widget.password,
switchUuid: widget.switchUuid,
forceRelay: widget.forceRelay,
tabWindowId: widget.tabWindowId,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
@@ -204,7 +207,7 @@ class _RemotePageState extends State<RemotePage>
// https://github.com/flutter/flutter/issues/64935
super.dispose();
debugPrint("REMOTE PAGE dispose session $sessionId ${widget.id}");
await _renderTexture.destroy();
await _renderTexture.destroy(widget.tabWindowId != null);
// ensure we leave this session, this is a double check
bind.sessionEnterOrLeave(sessionId: sessionId, enter: false);
DesktopMultiWindow.removeListener(this);