Skip to content

An open-source cross-platform alternative to AirDrop

fix: size and position init out of condition

Tien Do Namb88794620aa2
diff --git a/lib/init.dart b/lib/init.dart
index 2f3f58a0..ccd8cd05 100644
--- a/lib/init.dart
+++ b/lib/init.dart
@@ -84,17 +84,18 @@ Future<PersistenceService> preInit(List<String> args) async {
// initialize tray AFTER i18n has been initialized
await initTray();
+ // initialize size and position
+ final primaryDisplay = await screenRetriever.getPrimaryDisplay();
+ final width = (primaryDisplay.visibleSize ?? primaryDisplay.size).width;
+ if (width >= 1200) {
+ // make initial window size bigger as our display is big enough
+ windowManager.setSize(const Size(900, 600));
+ }
+ await windowManager.center();
+
if (!args.contains(launchAtStartupArg) || !persistenceService.isAutoStartLaunchMinimized()) {
// We show this app, when (1) app started manually, (2) app should not start minimized
// In other words: only start minimized when launched on startup and "launchMinimized" is configured
-
- final primaryDisplay = await screenRetriever.getPrimaryDisplay();
- final width = (primaryDisplay.visibleSize ?? primaryDisplay.size).width;
- if (width >= 1200) {
- // make initial window size bigger as our display is big enough
- windowManager.setSize(const Size(900, 600));
- }
- await windowManager.center();
await windowManager.show();
}
}