Skip to content

Commit 609df9d

Browse files
authored
fix: incorrect window size before/after setTitleBarStyle (#401)
- Fixes issue where setting both `size` and `setTitleBarStyle` using `WindowOptions` in `waitUntilReadyToShow` causes incorrect window size.
1 parent a26ce5b commit 609df9d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/src/window_manager.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ class WindowManager {
115115
]) async {
116116
await _channel.invokeMethod('waitUntilReadyToShow');
117117

118+
if (options?.titleBarStyle != null) {
119+
await setTitleBarStyle(
120+
options!.titleBarStyle!,
121+
windowButtonVisibility: options.windowButtonVisibility ?? true,
122+
);
123+
}
124+
118125
if (await isFullScreen()) await setFullScreen(false);
119126
if (await isMaximized()) await unmaximize();
120127
if (await isMinimized()) await restore();
@@ -138,12 +145,6 @@ class WindowManager {
138145
await setSkipTaskbar(options!.skipTaskbar!);
139146
}
140147
if (options?.title != null) await setTitle(options!.title!);
141-
if (options?.titleBarStyle != null) {
142-
await setTitleBarStyle(
143-
options!.titleBarStyle!,
144-
windowButtonVisibility: options.windowButtonVisibility ?? true,
145-
);
146-
}
147148

148149
if (callback != null) {
149150
callback();

0 commit comments

Comments
 (0)