-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Avoid color flash on window creation and resizing #71289
Conversation
On macOS, it's transition to the splash screen too fast to see background, but a few pixels of it can be visible if you resize the window really fast, so it will be useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too
Thank you SO MUCH! ❤️❤️❤️ |
Just for reference, Wayland "fixes" this problem by not mapping the window at all until a valid buffer is sent. |
Good to know. And how does resizing look there? |
@RandomShaper I think that it depends on the compositor, but sway and (IIRC) KDE look a bit... Meh, they resize the decorations and keep the buffer as-is, which is kinda ugly. No garbage, just transparency, but it still looks bad. There is a scaling thingamajig (wl_viewport) that can stretch the buffer in the meantime, but I didn't have much luck using it (random issues popped up) and it didn't look pretty either. |
On Windows (and maybe in some other windowing systems), when Godot creates a window, it's painted in white before the renderer has a chance to setup a swap chain or context. Windows being stretched also get the newly added region painted in that striking white for the brief time Godot can render something meaningful there.
This PR adds a little framework to let platform display managers to use a more suitable color in those early moments of the new pixels, plus it leverages it for Windows, where the flash of white is annoying.
All orbits around the concept of early clear color override:
I'm making this PR with the expectation that X11 and MacOS maintainers assess whether those platforms would benefit from this.
BEFORE 🤮
before.mp4
AFTER 😍
after.mp4