Skip to content

Fix initial visual artifacts, option to start hidden - #85

Open
cgostuff wants to merge 1 commit into
jchv:masterfrom
cgostuff:master
Open

Fix initial visual artifacts, option to start hidden#85
cgostuff wants to merge 1 commit into
jchv:masterfrom
cgostuff:master

Conversation

@cgostuff

@cgostuff cgostuff commented Jun 17, 2026

Copy link
Copy Markdown

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.

@cgostuff
cgostuff force-pushed the master branch 2 times, most recently from a0d6ab5 to ea6fa7a Compare June 17, 2026 19:31
@cgostuff
cgostuff marked this pull request as draft June 17, 2026 20:37
@cgostuff cgostuff changed the title Option to start as hidden to avoid initialization artifacting Fix initial visual artifacts, option to start hidden Jun 17, 2026
@cgostuff
cgostuff marked this pull request as ready for review June 17, 2026 21:06
@cgostuff
cgostuff marked this pull request as draft June 17, 2026 21:26
@cgostuff
cgostuff marked this pull request as ready for review June 17, 2026 21:44
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