window_manager
window_manager copied to clipboard
[Windows] Use frameless window to implement fullscreen
The current setFullscreen()
function on Windows may show the native window border as described in #211 and the application content may flicker after setFullscreen(true)
, Sometimes it may freeze the UI.
On windows, there is another way to make application fullscreen:
1.Set the application to use frameless window. 2.Set the window size to the screen size. 3.Make the window cover the whole screen.
The windows taskbar will automatically hide itself.
I use the window_size package to get screen size:
var info = await getCurrentScreen();
if (info != null) {
await windowManager.setAsFrameless();
await windowManager.setPosition(Offset.zero);
await windowManager.setSize(
Size(
info.frame.width / info.scaleFactor,
info.frame.height / info.scaleFactor,
),
);
}
When the application is maximized, use the original way to set fullscreen. This code to enter fullscreen mode works fine on my computer.
Could you provide an option to use this way to set fullscreen on windows?