Skip to content
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

Render one frame before showing the window to avoid flashing #777

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

Long0x0
Copy link
Contributor

@Long0x0 Long0x0 commented Dec 9, 2024

Fixes #590.

Demo:
capture

Copy link
Contributor

@jaredoconnell jaredoconnell left a comment

Choose a reason for hiding this comment

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

I can confirm that this works great on Windows 10. I'll let the other reviewers review the code itself.

surface,
accesskit_adapter: adapter,
};
self.render_root
.handle_window_event(WindowEvent::Rescale(scale_factor));
// Render one frame before showing the window to avoid flashing
if visible {
let (scene, _tree_update) = self.render_root.redraw();
Copy link
Member

@DJMcNab DJMcNab Dec 9, 2024

Choose a reason for hiding this comment

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

Discarding this tree update feels likely to be very bad. We need to at least reason about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, ignoring the tree update could lead to issues. I’ve updated the code to include it, following the approach used in handling the RedrawRequested event. Let me know if it looks good now.

@DJMcNab
Copy link
Member

DJMcNab commented Dec 10, 2024

I'm not set up to test accessibility on my machine yet. But this looks right to me now. I'm treating this similarly to #767, where it's a targeted fix which shouldn't lead to regressions.

@DJMcNab DJMcNab added this pull request to the merge queue Dec 10, 2024
Merged via the queue into linebender:main with commit 806ee4d Dec 10, 2024
17 checks passed
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.

White flash on app startup on Windows 11 dark mode
3 participants