-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
eframe: Don't show window until after initialization #2279
Conversation
Shortens #1802, but does not completely solve it
|
Thanks for working on this - this seems like a promising avenue to explore! |
I think it's actually Alright, it passes, and I also ran
I'm going to see if I can delay this until the first frame is already painted. That could eliminate the white flash altogether. A lot of the overhead seems to be glutin context creation which takes 500ms at best (iGPU) or 779ms at worst (dGPU). |
This resolves the white flash almost completely, but is a hack. Window visibility should be derived from the AppOutput, and the first frame should not be painted before the event loop has processed initial events. Working on a better implementation.
The window being shown is now properly delayed until the first frame is naturally rendered. The rendering is not forced / done prematurely, either. This also makes it possible to do something that you could not do before: keep the window completely hidden by calling There is still a very very brief (1 frame?) white flash. Maybe we could show the app on the second frame instead :^). Marking as ready for review. |
This allows an app to keep the window hidden (never shown) by calling Frame.set_visible(false) on the first update. This includes a slightly less nasty hack than the last commit did. Also fixes an accidental cross-contamination of pull requests.
* Don't show window until after initialization Shortens #1802, but does not completely solve it * format code * Present first frame immediately before showing window This resolves the white flash almost completely, but is a hack. Window visibility should be derived from the AppOutput, and the first frame should not be painted before the event loop has processed initial events. Working on a better implementation. * Integrate window showing with AppOutput This allows an app to keep the window hidden (never shown) by calling Frame.set_visible(false) on the first update. This includes a slightly less nasty hack than the last commit did. Also fixes an accidental cross-contamination of pull requests. * fmt * add comments * add comments * add comments * add comments Co-authored-by: Emil Ernerfeldt <[email protected]>
* Don't show window until after initialization Shortens emilk#1802, but does not completely solve it * format code * Present first frame immediately before showing window This resolves the white flash almost completely, but is a hack. Window visibility should be derived from the AppOutput, and the first frame should not be painted before the event loop has processed initial events. Working on a better implementation. * Integrate window showing with AppOutput This allows an app to keep the window hidden (never shown) by calling Frame.set_visible(false) on the first update. This includes a slightly less nasty hack than the last commit did. Also fixes an accidental cross-contamination of pull requests. * fmt * add comments * add comments * add comments * add comments Co-authored-by: Emil Ernerfeldt <[email protected]>
Shortens #1802, but does not completely solve it. This looks to be a step in the right direction, though, and eframe should have been doing this anyway.
Marked as draft because: