bitsdojo_window icon indicating copy to clipboard operation
bitsdojo_window copied to clipboard

Start app with window maximized properly

Open marcov-dart opened this issue 4 years ago • 2 comments
trafficstars

Is there a way to start an app with the window maximized properly?

Putting win.maximize() in doWhenWindowReady sortof works. You can add it either before or after win.show(), but in either case it doesn't really start out maximized and you can see the window resize a few times.

When I am not using bitsdojo_window I can edit win32_window.cpp and add WS_MAXIMIZE to CreateWindow and that works fine. Then app properly starts with the window maximized. But together with bitsdojo_window adding WS_MAXIMIZE to CreateWindow creates weird behaviour. The window starts with the given size in doWhenWindowReady. Pressing the maximize button once makes it bigger, but not maximized. Then only after pressing the button again does it become maximized.

marcov-dart avatar Jul 30 '21 03:07 marcov-dart

Thanks for reporting this. Added to my list.

bitsdojo avatar Aug 13 '21 09:08 bitsdojo

Hi, any update for this issue?

  doWhenWindowReady(() {
    const initialSize = Size(1200, 800);
    appWindow.size = initialSize;
    appWindow.minSize = const Size(800, 600);
    appWindow.title = gAppName;
    appWindow.maximize();
    appWindow.show();
  });

I want to make my app maximized on startup. It can be done as above, put "appWindow.maximize();" before "appWindow.show();". But it looks like the window size changs twice, the first one is bigger than the screen, then the second is maximized.

flutter: 3.3.0 bitsdojo_window: 0.1.2

ngugcx avatar Sep 02 '22 06:09 ngugcx