Skip to content

Commit

Permalink
Fix window init
Browse files Browse the repository at this point in the history
  • Loading branch information
redsolver committed Sep 17, 2023
1 parent 4c22ad4 commit b175e13
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -403,30 +403,6 @@ void main(List<String> args) async {
vupServer.listen(43912, InternetAddress.loopbackIPv4, false);
}

if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
await windowManager.ensureInitialized();

WindowOptions windowOptions = WindowOptions(
minimumSize: Size(300, 440),
title: 'Vup Cloud Storage', // TODO Localization

// size: Size(800, 600),
center: true,
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
);

windowManager.waitUntilReadyToShow(windowOptions, () async {
if (isStartMinimizedEnabled) {
await windowManager.hide();
} else {
await windowManager.show();
await windowManager.focus();
}
});
}

/* if (Platform.isWindows || Platform.isLinux) {
await Window.initialize();
await Window.setEffect(
Expand Down Expand Up @@ -547,6 +523,29 @@ void main(List<String> args) async {
MyApp(),
/* ), */
);
if (Platform.isLinux || Platform.isWindows || Platform.isMacOS) {
await windowManager.ensureInitialized();

WindowOptions windowOptions = WindowOptions(
minimumSize: Size(300, 440),
title: 'Vup Cloud Storage', // TODO Localization

// size: Size(800, 600),
center: true,
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
);

windowManager.waitUntilReadyToShow(windowOptions, () async {
if (isStartMinimizedEnabled) {
await windowManager.hide();
} else {
await windowManager.show();
await windowManager.focus();
}
});
}

// await Window.initialize();

Expand Down

0 comments on commit b175e13

Please sign in to comment.