diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index a53dd14db..b6a2aad96 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -58,14 +58,12 @@ Future main(List args) async { // Because stateGlobal.windowId is a global value. argument['windowId'] = kWindowId; kWindowType = type.windowType; - final windowName = getWindowName(); switch (kWindowType) { case WindowType.RemoteDesktop: desktopType = DesktopType.remote; runMultiWindow( argument, kAppTypeDesktopRemote, - windowName, ); break; case WindowType.FileTransfer: @@ -73,7 +71,6 @@ Future main(List args) async { runMultiWindow( argument, kAppTypeDesktopFileTransfer, - windowName, ); break; case WindowType.PortForward: @@ -81,7 +78,6 @@ Future main(List args) async { runMultiWindow( argument, kAppTypeDesktopPortForward, - windowName, ); break; default: @@ -162,9 +158,9 @@ void runMobileApp() async { void runMultiWindow( Map argument, String appType, - String title, ) async { await initEnv(appType); + final title = getWindowName(); // set prevent close to true, we handle close event manually WindowController.fromWindowId(kWindowId!).setPreventClose(true); late Widget widget;