Fix initial visual artifacts, option to start hidden - #85
Open
cgostuff wants to merge 1 commit into
Open
Conversation
cgostuff
force-pushed
the
master
branch
2 times, most recently
from
June 17, 2026 19:31
a0d6ab5 to
ea6fa7a
Compare
cgostuff
marked this pull request as draft
June 17, 2026 20:37
cgostuff
marked this pull request as ready for review
June 17, 2026 21:06
cgostuff
marked this pull request as draft
June 17, 2026 21:26
cgostuff
marked this pull request as ready for review
June 17, 2026 21:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When creating a webview, initially there is some artifacting where a blank window will render for a few milliseconds before resizing slightly and then showing properly. From what I gather this is a WebView2 issue. Even hiding the native window immediately upon creation programmatically this artifacting/flashing still occurs.
Here I moved the call to show the native window until after everything is initialized, and this avoids the initial visual artifacts. To make it work I had to also explicitly show the browser at this point, which calls PutIsVisible(true) on the chromium controller, or else the webview would remain blank. I added a Show function to the browser interface in order to be able to call chromium's Show function.
Added the option to start with the native window hidden, as this can be useful in some use cases and allows for pre-initializing the webview. I also added Show and Hide helper functions to the WebView interface to make it easy to toggle visibility.