eframe: window flashes white on launch on Windows
eframe = { git = "https://github.com/emilk/egui", branch = "master" }
Describe the bug Wheb the window show it's kinda buggy it's light then dark
To Reproduce
A bit modified the example code with name and age

Expected behavior Appear dark
Screenshots See to reproduce for GIF
Desktop (please complete the following information):
- OS: Windows 10
- Browser I don't use a browser
- Version I'm still using the libs directly
Additional context None
How annoying! On Mac it works well. Is it the same using egui-wgpu as the backend?
Perhaps add a few breakpoints and try to find out what goes wrong!
How annoying! On Mac it works well. Is it the same using
egui-wgpuas the backend?Perhaps add a few breakpoints and try to find out what goes wrong!
Hello, it's not very annoying but I was thiking it would be good if it's possible to fix it ! And yeah even with using egui-wgpu I get the same result !
"Bump"
@HideakiAtsuyo since this affects your computer and you are a programmer, maybe you can investigate?
@HideakiAtsuyo since this affects your computer and you are a programmer, maybe you can investigate?
The only solution that I have for this situation that would not necessarely require to modify the crate is to hide the windows until it's fully loaded
- I'm not a maintainer of egui 🤔
You are not the maintainer, but you can become a contributor.
I have a thousand things to do that has a higher priority, so if you want this to be fixed, you better roll up your sleeves.
You are not the maintainer, but you can become a contributor.
I have a thousand things to do that has a higher priority, so if you want this to be fixed, you better roll up your sleeves.
It's not a priority I never said that, I'm using Rust very rarely sadly it was just for 1 project nothing more
when you create glutin context on windows, it creates white window, which stays white until content gets swapped into it
when you create glutin context on linux, it creates a hidden window (icon in taskbar, but no ability to click into it)
that's the difference, very much reproduceable for me with all glutin examples, for example this one creates a white window for me on windows only:
let el = glutin::event_loop::EventLoop::new();
let wb = glutin::window::WindowBuilder::new()
.with_title("Hello world!")
.with_inner_size(glutin::dpi::LogicalSize::new(200.0, 200.0));
let windowed_context = glutin::ContextBuilder::new()
.build_windowed(wb, &el)
.unwrap();
I'm not sure what's the right behavior is, but it probably should be reported in that package (didn't find any existing tickets)
when you create
glutincontext on windows, it creates white window, which stays white until content gets swapped into itwhen you create
glutincontext on linux, it creates a hidden window (icon in taskbar, but no ability to click into it)that's the difference, very much reproduceable for me with all glutin examples, for example this one creates a white window for me on windows only:
let el = glutin::event_loop::EventLoop::new(); let wb = glutin::window::WindowBuilder::new() .with_title("Hello world!") .with_inner_size(glutin::dpi::LogicalSize::new(200.0, 200.0)); let windowed_context = glutin::ContextBuilder::new() .build_windowed(wb, &el) .unwrap();I'm not sure what's the right behavior is, but it probably should be reported in that package (didn't find any existing tickets)
The best one for lazy people like me would be to hide the windows until it's loaded until the packages receive the necessarily updates to "fix it" on Windows, that would not be the hardest to do I think but still need to add code for stuff that could be managed by the packages
The window also flashes white while it's being resized with the glow backend
https://user-images.githubusercontent.com/4723091/201222028-30b3777d-603a-4eb4-8f12-d4995f34bc4d.mp4
(sorry for the small size, can't do a larger recording or else it slows down my computer enough to make it not flash white?)
The white on launch happens with both glow and wgpu backends. However, the wgpu backend does not flash white on resize. It also does not render text (??) and has its own horrible resizing artifacts:
https://user-images.githubusercontent.com/4723091/201222261-57793ef1-e706-4849-89f8-4c51174c96ea.mp4
Here is a flame graph of the white flash: (click to make it interactive)
It looks like this is impossible to work around as a user of eframe since the CreationContext gives me no access to the winit window. But that also wouldn't be able to change the window construction options, ideally it should be constructed completely hidden while the glutin context is created. (PR time?)
Anyway... the context creation is slow as hell. I guess my drivers are just dumb, but this happens with both GPUs (dedicated and integrated). Here is iGPU flamegraph:
Notably this one only takes around 520ms to create the context instead of 779ms+ like the Nvidia drivers. But... it's still a noticeable white flash.