MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
431 stars 51 forks source link

Large gray rectangles issue with WebVew2 control in wpf when idle #1113

Open rahullore opened 3 years ago

rahullore commented 3 years ago

We are trying to migrate to webview2 control in WPF application. However, when I used the control as directed I came across this weird pixelation issue. I am attaching a screenshot of it. This happens after a few seconds when the screen remains idle and as soon as I move the mouse over it automatically corrects itself.

I have my control directly in a grid control Capture

AB#33408986

rahullore commented 3 years ago

Kindly note everything works perfectly fine in Browser control

champnic commented 3 years ago

Hey @rahullore - thanks for the feedback! We haven't seen anything like this before. Could you add some details around what SDK version, runtime version, and UI framework version you are using? If you can share any setup code or a repro app that would be helpful as well.

rahullore commented 3 years ago

Thanks for getting back. This happens only when I launch my application using a remote desktop when I run the same exe from local everything works perfectly without any issue. BTW that rectangle color completely depends on the background color of the host control example I am using a dock panel with background color white, then these rectangle(s) would show as white color, also it is worth noting these rectangle(s) are completely random meaning if I continue to live the session idle it keeps growing in sizing at a different location on the form. The workaround code I wrote is to reload the page if it's idle for 30 seconds based on mouse move moment and as soon as I reload the page everything looks fine.

A little background about how am I using control. It's WPF custom control which looks like a button when the user clicks on the button we show the control(webview2) with a website loaded in it when the user clicks on hide we call logout URL and hide the control(webview2). Kindly note control is loaded as soon as the form is loaded but it may and may not be visible to the user.

I will add the code snippet soon

Details Framework version: 4.7

lukesharmansmith commented 3 years ago

We are also seeing this in our app. Our app has a web browser than can be opened that overlays the entire app. We see the same grey blocks that seem to correspond to elements in the background that have animations or have updated recently. We do not have this issue with the previous WebBrowser control.

This cannot be replicated on Windows 10 and only seen on Windows 8.1 our app is WPF running .net framework 4.7.2

I've included a project that replicates the behaviour we see using an animated element that is in the background. This gives the same result as our app in 8.1 environments but works under 10.

image (9)

EdgeGreyBlockRepro.zip

champnic commented 3 years ago

@lukesharmansmith Thanks for the repro and extra info. Are you running the Win10 version locally on your machine, and the Win8.1 over RDP or on a VM? Do you know if this is a recent regression, or has it always behaved this way on 8.1?

lukesharmansmith commented 3 years ago

On 8.1 we've seen the issue while running locally and over RDP. Windows 10 was only tested over RDP but doesn't have the issue.

Its always behaved this way from what we are seeing. We are currently in the process of upgrading from the old WebBrowser control and this was spotted during initial testing on 8.1.