An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.
Rust androidanydeskdartflatpakflutterflutter-appsioslinuxmacosp2prdpremote-controlremote-desktoprustrust-langteamviewervncwaylandwindows
opt close on taskbar, not call onWindowClose multi times
21pages0d01aa4eea53
diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dartindex 7f1449ca4..67931d353 100644--- a/flutter/lib/desktop/widgets/tabbar_widget.dart+++ b/flutter/lib/desktop/widgets/tabbar_widget.dart@@ -583,32 +583,19 @@ class WindowActionPanelState extends State<WindowActionPanel>void onWindowClose() async {mainWindowClose() async => await windowManager.hide();notMainWindowClose(WindowController controller) async {- if (widget.tabController.length == 0) {- debugPrint("close emtpy multiwindow, hide");- await controller.hide();- await rustDeskWinManager- .call(WindowType.Main, kWindowEventHide, {"id": kWindowId!});- } else {+ if (widget.tabController.length != 0) {debugPrint("close not emtpy multiwindow from taskbar");if (Platform.isWindows) {await controller.show();await controller.focus();final res = await widget.onClose?.call() ?? true;- if (res) {- Future.delayed(Duration.zero, () async {- // onWindowClose will be called again to hide- await WindowController.fromWindowId(kWindowId!).close();- });- }- } else {- // ubuntu22.04 windowOnTop not work from taskbar- widget.tabController.clear();- Future.delayed(Duration.zero, () async {- // onWindowClose will be called again to hide- await WindowController.fromWindowId(kWindowId!).close();- });+ if (!res) return;}+ widget.tabController.clear();}+ await controller.hide();+ await rustDeskWinManager+ .call(WindowType.Main, kWindowEventHide, {"id": kWindowId!});}macOSWindowClose(