Open ibaoyun opened 4 months ago
Yes, I'm facing the same issue, when I switch from one display to another.
You can skip the issue until it is resolved .
const WindowOptions windowOptions = WindowOptions( size: Size(800, 600), center: true, backgroundColor: Colors.transparent, skipTaskbar: false, // titleBarStyle: TitleBarStyle.hidden, ); windowManager.waitUntilReadyToShow(windowOptions, () async { await windowManager.show(); await windowManager.focus(); await windowManager.setFullScreen(true); });
In the setFullScreen function , setSize is Future function need await // (Windows) Force refresh the app so it 's back to the correct size // (see GitHub issue #311) if (Platform.isWindows) { final size = await getSize(); setSize(size + const Offset(1, 1)); setSize(size); }
Just to add: There's a working plugin for windows here: https://pub.dev/packages/fullscreen_window - might be interesting to compare the code and evaluate the differences.
During
waitUntilReadyToShow
, thefullScreen
is set totrue
. However, when the window is restored usingsetFullScreen(false)
, it only displays the background color without any content and the taskbar icon also disappears. Additionally, callingwindowManager.minimize();
has no effect either. The platform in use is Windows.