diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index c767014ea..ef4ec81c8 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -117,12 +117,23 @@ void runFileTransferScreen(Map argument) async { } void runConnectionManagerScreen() async { + // initialize window + WindowOptions windowOptions = WindowOptions( + size: Size(300, 400), + center: true, + backgroundColor: Colors.transparent, + skipTaskbar: false, + titleBarStyle: TitleBarStyle.normal, + ); await Future.wait([ initEnv(kAppTypeConnectionManager), - windowManager - .setSize(Size(300, 400)) - .then((value) => windowManager.setAlignment(Alignment.topRight)) + windowManager.waitUntilReadyToShow(windowOptions, () async { + await windowManager.setAlignment(Alignment.topRight); + await windowManager.show(); + await windowManager.focus(); + }) ]); + ; runApp(GetMaterialApp(theme: getCurrentTheme(), home: DesktopServerPage())); } diff --git a/flutter/linux/my_application.cc b/flutter/linux/my_application.cc index 25e9858cc..20513032d 100644 --- a/flutter/linux/my_application.cc +++ b/flutter/linux/my_application.cc @@ -1,7 +1,6 @@ #include "my_application.h" #include -// #include #ifdef GDK_WINDOWING_X11 #include #endif @@ -48,8 +47,8 @@ static void my_application_activate(GApplication* application) { gtk_window_set_title(window, "rustdesk"); } - // auto bdw = bitsdojo_window_from(window); // <--- add this line - // bdw->setCustomFrame(true); // <-- add this line + // auto bdw = bitsdojo_window_from(window); // <--- add this line + // bdw->setCustomFrame(true); // <-- add this line gtk_window_set_default_size(window, 1280, 720); // <-- comment this line gtk_widget_show(GTK_WIDGET(window)); diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index fcc7b5f49..caa12313d 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -66,7 +66,6 @@ dependencies: git: url: https://github.com/Kingtous/rustdesk_desktop_multi_window ref: 2b1176d53f195cc55e8d37151bb3d9f6bd52fad3 - # bitsdojo_window: ^0.1.2 freezed_annotation: ^2.0.3 tray_manager: 0.1.7 get: ^4.6.5