From f64dd3794a23f9e156a7408ce343d883babf4515 Mon Sep 17 00:00:00 2001 From: dignow Date: Thu, 3 Aug 2023 18:15:50 +0800 Subject: [PATCH] better restore window size Signed-off-by: dignow --- flutter/lib/common.dart | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 903eb0e11..b467f8484 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -1419,24 +1419,10 @@ Future saveWindowPosition(WindowType type, {int? windowId}) async { } Future _adjustRestoreMainWindowSize(double? width, double? height) async { - const double minWidth = 600; - const double minHeight = 100; - double maxWidth = (((isDesktop || isWebDesktop) - ? kDesktopMaxDisplaySize - : kMobileMaxDisplaySize)) - .toDouble(); - double maxHeight = ((isDesktop || isWebDesktop) - ? kDesktopMaxDisplaySize - : kMobileMaxDisplaySize) - .toDouble(); - - if (isDesktop || isWebDesktop) { - final screen = (await window_size.getWindowInfo()).screen; - if (screen != null) { - maxWidth = screen.visibleFrame.width; - maxHeight = screen.visibleFrame.height; - } - } + const double minWidth = 1; + const double minHeight = 1; + const double maxWidth = 6480; + const double maxHeight = 6480; final defaultWidth = ((isDesktop || isWebDesktop) ? 1280 : kMobileDefaultDisplayWidth)