Fix. MacOS, incoming only, restore pos ()

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2024-03-15 08:42:41 +08:00 committed by GitHub
parent a9b0bc0409
commit 411384f0e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1552,7 +1552,13 @@ Future<void> saveWindowPosition(WindowType type, {int? windowId}) async {
switch (type) {
case WindowType.Main:
isMaximized = await windowManager.isMaximized();
// Checking `bind.isIncomingOnly()` is a simple workaround for MacOS.
// `await windowManager.isMaximized()` will always return true
// if is not resizable. The reason is unknown.
//
// `windowManager.setResizable(!bind.isIncomingOnly());` in main.dart
isMaximized =
bind.isIncomingOnly() ? false : await windowManager.isMaximized();
position = await windowManager.getPosition();
sz = await windowManager.getSize();
setFrameIfMaximized();