diff --git a/flutter/lib/models/state_model.dart b/flutter/lib/models/state_model.dart index bc80fdf0e..53f1a19b1 100644 --- a/flutter/lib/models/state_model.dart +++ b/flutter/lib/models/state_model.dart @@ -1,4 +1,7 @@ +import 'dart:io'; + import 'package:desktop_multi_window/desktop_multi_window.dart'; +import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../consts.dart'; @@ -26,7 +29,20 @@ class StateGlobal { _resizeEdgeSize.value = fullscreen ? kFullScreenEdgeSize : kWindowEdgeSize; _windowBorderWidth.value = fullscreen ? 0 : kWindowBorderWidth; - WindowController.fromWindowId(windowId).setFullscreen(_fullscreen); + WindowController.fromWindowId(windowId) + .setFullscreen(_fullscreen) + .then((_) { + // https://github.com/leanflutter/window_manager/issues/131#issuecomment-1111587982 + if (Platform.isWindows && !v) { + Future.delayed(Duration.zero, () async { + final frame = + await WindowController.fromWindowId(windowId).getFrame(); + final newRect = Rect.fromLTWH( + frame.left, frame.top, frame.width + 1, frame.height + 1); + await WindowController.fromWindowId(windowId).setFrame(newRect); + }); + } + }); } }