New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug on windowManager.setSize method #67
Comments
I think it happening because c++ works before then dart code. So if you even fix this issue (in dart) it will flicker and it cause another issue. One way to fix this is to change the native code. (I dont know if there is another way to fix it) For linux: static void my_application_activate(GApplication* application) {
// ...
gtk_window_set_default_size(window, 1280, 720); //<-- You should change that
//...
} For windows: int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
// ...
Win32Window::Size size(1280, 720); //<--You should change that
// ...
} For macos: I hope this will fix your issue. My english is not so very well. I apologize if i made a mistake or misunderstood. |
Another alternative is to hide the app until it's fully started/loaded and then change the size before showing it. |
Also to note: |
What's the code for that? |
Do this Hide at launch windowManager.waitUntilReadyToShow().then((_) async {
// ... maybe some code
await windowManager.setSize(Size(800, 600));
// ... maybe some other code
}); Sorry for the late response |
I saw the Hide at launch section but unfortunately there's no information on how to handle linux. Anyway the issue appears only when the app first start, if I then press the green rounded arrow on VSCode it resizes and for now I'm fine with that. I run the app as Linux Desktop app only on development because is faster than the Android Emulator. |
A solution is proposed here #206 (comment) |
Hi everyone and thanks for this useful package! I've got a little problem with my app because I noticed a weird behaviour with the windowManager.setSize method.
When my app starts I want the size of the window to
Size(385, 835)
but when I first run the app it stars much larger (I think at 800x600) and only if I re-run it with the green rounded arrow on VSCode it resizes correctly.I also tried to use
windowManager.setResizable(false)
,windowManager.setMinimumSize(const Size(385, 835))
andwindowManager.setMaximumSize(const Size(385, 835))
but the behavior is similar.In particular I noticed that if I use the setResizable() method the window is never at
Size(385, 835)
, it starts big and, obviously, I cannot resize it.This is the minimum reproducible code:
This is my
flutter doctor
Thanks,
Alberto
The text was updated successfully, but these errors were encountered: