Skip to content

eframe: Fix window flashing white on launch#3631

Merged
emilk merged 2 commits intoemilk:masterfrom
zeozeozeo:no-window-flash
Nov 27, 2023
Merged

eframe: Fix window flashing white on launch#3631
emilk merged 2 commits intoemilk:masterfrom
zeozeozeo:no-window-flash

Conversation

@zeozeozeo
Copy link
Copy Markdown
Contributor

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

window-flash

After

no-window-flash

Closes #3625.

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.
Copy link
Copy Markdown
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@emilk emilk added bug Something is broken eframe Relates to epi and eframe native-windows Running on native Windows OS labels Nov 27, 2023
@emilk emilk merged commit 4dc964a into emilk:master Nov 27, 2023
@zeozeozeo zeozeozeo deleted the no-window-flash branch November 27, 2023 09:37
gcailly added a commit to gcailly/egui that referenced this pull request Mar 12, 2026
The existing fix (PR emilk#3631) starts the root window hidden and shows it
after the first frame is painted. However, deferred and immediate
viewports created later are still visible immediately, causing a white
flash before the first frame is rendered.

This applies the same pattern to non-root viewports: create them with
visible(false) and call window.set_visible(true) after the first
frame has been painted and presented.

Note: I am not a Rust programmer — this PR was developed with the
help of Claude Code. Happy to address any feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is broken eframe Relates to epi and eframe native-windows Running on native Windows OS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window flashes white on launch on Windows

2 participants