fix: last window location calculation

This commit is contained in:
Kingtous
2022-11-09 15:14:11 +08:00
parent 2af6441495
commit 200d8dc0f5
6 changed files with 38 additions and 27 deletions

View File

@@ -96,8 +96,7 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
void onRemoveId(String id) {
if (tabController.state.value.tabs.isEmpty) {
WindowController.fromWindowId(windowId()).hide();
rustDeskWinManager.call(WindowType.Main, kWindowEventHide, {"id": windowId()});
WindowController.fromWindowId(windowId()).close();
}
}

View File

@@ -107,8 +107,7 @@ class _PortForwardTabPageState extends State<PortForwardTabPage> {
void onRemoveId(String id) {
if (tabController.state.value.tabs.isEmpty) {
WindowController.fromWindowId(windowId()).hide();
rustDeskWinManager.call(WindowType.Main, kWindowEventHide, {"id": windowId()});
WindowController.fromWindowId(windowId()).close();
}
}

View File

@@ -97,9 +97,6 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
}
_update_remote_count();
});
Future.delayed(Duration.zero, () {
restoreWindowPosition(WindowType.RemoteDesktop, windowId: windowId());
});
}
@override
@@ -321,10 +318,9 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
);
}
void onRemoveId(String id) {
void onRemoveId(String id) async {
if (tabController.state.value.tabs.isEmpty) {
WindowController.fromWindowId(windowId()).hide();
rustDeskWinManager.call(WindowType.Main, kWindowEventHide, {"id": windowId()});
await WindowController.fromWindowId(windowId()).close();
}
ConnectionTypeState.delete(id);
_update_remote_count();