From 4fc65aac84796d28f83ed6ea8721b4bbf06fd5b4 Mon Sep 17 00:00:00 2001 From: dignow Date: Sun, 3 Sep 2023 22:27:42 +0800 Subject: [PATCH] Remote window restore, add 300 milliseconds delay for maximizing after the frame is restored Signed-off-by: dignow --- flutter/lib/common.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 48323d5fa..208c7f7c8 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1699,7 +1699,10 @@ Future restoreWindowPosition(WindowType type, } if (lpos.isMaximized == true) { await restoreFrame(); - await wc.maximize(); + // An duration is needed to avoid the window being restored after maximized. + Future.delayed(Duration(milliseconds: 300), () async { + await wc.maximize(); + }); } else { await restoreFrame(); }