Skip to content

Commit

Permalink
fix: incorrect window size before/after setTitleBarStyle (#401)
Browse files Browse the repository at this point in the history
- Fixes issue where setting both `size` and `setTitleBarStyle` using `WindowOptions` in `waitUntilReadyToShow` causes incorrect window size.
  • Loading branch information
wisetarman authored Oct 8, 2023
1 parent a26ce5b commit 609df9d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/src/window_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ class WindowManager {
]) async {
await _channel.invokeMethod('waitUntilReadyToShow');

if (options?.titleBarStyle != null) {
await setTitleBarStyle(
options!.titleBarStyle!,
windowButtonVisibility: options.windowButtonVisibility ?? true,
);
}

if (await isFullScreen()) await setFullScreen(false);
if (await isMaximized()) await unmaximize();
if (await isMinimized()) await restore();
Expand All @@ -138,12 +145,6 @@ class WindowManager {
await setSkipTaskbar(options!.skipTaskbar!);
}
if (options?.title != null) await setTitle(options!.title!);
if (options?.titleBarStyle != null) {
await setTitleBarStyle(
options!.titleBarStyle!,
windowButtonVisibility: options.windowButtonVisibility ?? true,
);
}

if (callback != null) {
callback();
Expand Down

0 comments on commit 609df9d

Please sign in to comment.