leanflutter / window_manager

This plugin allows Flutter desktop apps to resizing and repositioning the window.
https://pub.dev/packages/window_manager
MIT License
724 stars 205 forks source link

[Windows] Use frameless window to implement fullscreen #456

Open YuiHrsw opened 6 months ago

YuiHrsw commented 6 months ago

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?