Sometimes WebView2 browser doesn't render
I don't know if this is a WebView2 issue or a LINQPad issue (or both). Occasionally (and it's uncommon), I have an issue where the browser displayed in a dump panel doesn't ever render unless I switch off the panel and back. Switching between queries or swapping from/to LINQPad doesn't trigger it. When it doesn't render, it just displays whatever is in the background of the application. Here's an example:
Selecting one of the other panels and going back triggers the correct display
Any thoughts on how to troubleshoot this?
Comments
This is a known issue - I believe some quirk within the OS or some other software running on the machine can cause this to happen occasionally. What LINQPad must do to make the control behave as a child without joining the message loops is really complicated: it must fight with the OS and other applications, and occasionally it loses.
Is there any way to detect this and recover?
It happens for me a few times a year, so trying to reproduce this is near impossible. I suspect Windows is failing to respond to a request to update the z-order.
I can't reproduce it on command, but when generating a bunch of panels in a series of long-running processes, it does happen.