eframe: Fix window flashing white on launch (#3631)
This is a bug that can occur on Windows, previously it was fixed by only showing the window after the first frame was rendered, but the bug appeared again with egui 0.24.0. This commit fixes this bug by making the window invisible on startup. ## Before  ## After  <!-- Please read the "Making a PR" section of [`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/master/CONTRIBUTING.md) before opening a Pull Request! * Keep your PR:s small and focused. * If applicable, add a screenshot or gif. * If it is a non-trivial addition, consider adding a demo for it to `egui_demo_lib`, or a new example. * Do NOT open PR:s from your `master` branch, as that makes it hard for maintainers to add commits to your PR. * Remember to run `cargo fmt` and `cargo cranky`. * Open the PR as a draft until you have self-reviewed it and run `./scripts/check.sh`. * When you have addressed a PR comment, mark it as resolved. Please be patient! I will review your PR, but my time is limited! --> Closes https://github.com/emilk/egui/issues/3625.
This commit is contained in:
parent
43e7b16bb1
commit
4dc964ab4b
|
|
@ -154,7 +154,8 @@ impl GlowWinitApp {
|
|||
event_loop,
|
||||
native_options,
|
||||
window_settings,
|
||||
);
|
||||
)
|
||||
.with_visible(false); // Start hidden until we render the first frame to fix white flash on startup (https://github.com/emilk/egui/pull/3631)
|
||||
|
||||
let mut glutin_window_context = unsafe {
|
||||
GlutinWindowContext::new(egui_ctx, winit_window_builder, native_options, event_loop)?
|
||||
|
|
|
|||
|
|
@ -837,7 +837,9 @@ fn create_window(
|
|||
event_loop,
|
||||
native_options,
|
||||
window_settings,
|
||||
);
|
||||
)
|
||||
.with_visible(false); // Start hidden until we render the first frame to fix white flash on startup (https://github.com/emilk/egui/pull/3631)
|
||||
|
||||
let window = {
|
||||
crate::profile_scope!("WindowBuilder::build");
|
||||
create_winit_window_builder(egui_ctx, event_loop, viewport_builder.clone())
|
||||
|
|
|
|||
Loading…
Reference in New Issue