From 411384f0e75a9c5e3f04c0aa2908d599597db930 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 15 Mar 2024 08:42:41 +0800 Subject: [PATCH] Fix. MacOS, incoming only, restore pos (#7392) Signed-off-by: fufesou --- flutter/lib/common.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 83f128a91..f98e1dd08 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1552,7 +1552,13 @@ Future 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();