Closed Markus43 closed 5 months ago
Heya, I can reproduce this. Thanks for the detailed info! I'll look into it.
Alright found the fix. Maybe will open a PR soon.
Sorry, nevermind that, I was mistaken.
For a workaround, you can call show()
after the first setFullScreen(false)
. I haven't tested it yet but I think it should work. Tell me if it doesn't.
I'll explain later.
Okay so basically, here's a breakdown.
setFullScreen(true)
works like this:
setFullScreen(false)
works like this:
What's the problem here?
You see, when the app is first launched, a certain window style is omitted (WS_VISIBLE
). As its name, if this style is not included, then the app is not shown.
Therefore, achieving hide app at launch
.
Now, let's go back to the fullscreen implementation.
Since fullscreen: true
is set before the show()
, the window style that is saved doesn't include WS_VISIBLE
. (I verified this using Spy++)
As a side effect, when we set the fullscreen
back to false, the window is gone.
What would fix this?
In the native side, I don't know. I'm not proficient in C++. I just try things and see if it works. And I haven't found things that work yet.
In the dart side, calling show()
after setFullScreen(false)
works. I have tested it.
If anyone has an idea, feel free to chime in.
Many thanks for the quick response! I can confirm that the workaround (call show after setFullScreen(false)) works.
for workaround instead of specifying fullscreen: true
in WindowOptions
call await windowManager.setFullScreen(true);
in waitUntilReadyToShow
after await windowManager.show();
WindowOptions windowOptions = WindowOptions(
center: true,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.hidden,
// fullScreen: true,
);
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.show();
await windowManager.focus();
await windowManager.setFullScreen(true);
});
@lijy91 I still can reproduce my original issue, so this bug is not solved yet.
My use case:
When disabling fullscreen mode, the window looses focus and I cannot click on the window anymore.
To reproduce this with the example project:
As a result, the app gets resized, its elements are not resized and the app looses focus. The app remains visible. The app cannot be clicked anymore: When I try to click on the app, the click goes to the window behind my app or to the desktop. So the app is not usable anymore, and it is not possible to bring it back to life or to even quit it.
As a temporary alternative for Windows, I switched to https://pub.dev/packages/fullscreen_window which works for this particular usecase, just as a reference that might help for a bugfix.