-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
How to hide window on startup? #206
Comments
Maybe I've found the solution. Open gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window)); add gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
gtk_widget_hide(GTK_WIDGET(window)); I'm testing on WSL and it kind of works. :) |
@FeodorFitsner I tried it but it messes up the size of the window :( |
Alright, let's wait for an official solution then? 🤷🏻♂️ |
I'm having same problem. That period of "2 seconds with no paint" at start-up is driving me crazy. The In essence, what an approach should be that window launches without any visibility at startup & then Dart-VM/Flutter notifies back to GTK through platform channels that "first frame has been rasterized, now we're ready to actually show the window.". But since, when window is hidden (using So, an another approach to make window invisible is using:
By this, waitUntilFirstFrameRasterized actually gets called & Flutter gets rendered. Once, waitUntilFirstFrameRasterized is received notify back GTK with:
Having The problem still with this is that, we'll still have a window (though invisible, non-clickable & completely undetectable) during that "2 seconds with no paint", which can result in some weird situations for some things like tiling window managers, I guess. This is the only solution, otherwise I just feel Flutter will need changes in flutter/engine itself. P.S. I have tested it. |
Have you tried /// Hide window by default so we can manipulate size, frame, etc and
/// then show the window when we are ready.
///
/// `gtk_widget_realize` will create the window without showing it,
/// then the Dart code can call `windowManager.show();`.
// gtk_widget_show(GTK_WIDGET(window)); <-- Previous implementation.
gtk_widget_realize(GTK_WIDGET(window)); |
@Merrit Thanks a lot for the info, I'll add it to the readme |
* A few server-side tests * FilePicker without upload * Allow multiple copies of Flet window on macOS Fix #249 * Upload dir on Python side, upload URL gen * FilePicker with upload * Upload progress complete * offstage -> overlay * Disable CORS * FilePicker methods with parameters * Renamed again * gtk_widget_realize() Based on leanflutter/window_manager#206
Is there any way to hide window on startup for linux?
The text was updated successfully, but these errors were encountered: