Skip to content

Commit

Permalink
fix(mobile): do not initialize window_manager on mobile platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Oct 4, 2024
1 parent 98120bf commit 581f161
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ Future<void> main(List<String> args) async {
LocaleSettings.setLocale(locale);
}

await windowManager.ensureInitialized();

if (isDesktop && !cmdArgs.noWindowConfigs) {
await desktopUpdateWindowTitle();
if (settings.windowInCenter) {
await windowManager.center();
} else if (settings.windowRememberPosition &&
settings.windowPosition != Offset.zero) {
await windowManager.setPosition(settings.windowPosition);
}
if (settings.windowRememberSize && settings.windowSize != Size.zero) {
await windowManager.setSize(settings.windowSize);
if (isDesktop) {
await windowManager.ensureInitialized();
if (!cmdArgs.noWindowConfigs) {
await desktopUpdateWindowTitle();
if (settings.windowInCenter) {
await windowManager.center();
} else if (settings.windowRememberPosition &&
settings.windowPosition != Offset.zero) {
await windowManager.setPosition(settings.windowPosition);
}
if (settings.windowRememberSize && settings.windowSize != Size.zero) {
await windowManager.setSize(settings.windowSize);
}
}
}

Expand Down

0 comments on commit 581f161

Please sign in to comment.