Skip to content

eframe: Fix white flash when opening non-root viewports on Windows#7970

Open
gcailly wants to merge 1 commit intoemilk:mainfrom
gcailly:fix/windows-viewport-white-flash
Open

eframe: Fix white flash when opening non-root viewports on Windows#7970
gcailly wants to merge 1 commit intoemilk:mainfrom
gcailly:fix/windows-viewport-white-flash

Conversation

@gcailly
Copy link

@gcailly gcailly commented Mar 12, 2026

Summary

The existing fix (PR #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 brief white flash before the first frame is rendered.

This PR applies the same pattern to non-root viewports:

  • Create them with visible(false)
  • Call window.set_visible(true) after the first frame has been painted and presented

Both the glow and wgpu backends are covered.

Before and after

Untitled.mp4

Test plan

  • Tested with the multiple_viewports example on Windows 11
  • Verified with both dark and light themes (no black flash in light mode either)
  • Root window behavior is unchanged (still handled by EpiIntegration::post_rendering)

Disclaimer: I am not a Rust programmer — this PR was developed with the help of Claude Code. Happy to address any feedback.

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.
@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Preview available at https://egui-pr-preview.github.io/pr/7970-fixwindows-viewport-white-flash
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant