Skip to content
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

Webview2 repaint is omitted sometimes when no debugger is attached #3674

Closed
kodfodrasz opened this issue Jul 31, 2023 · 2 comments
Closed

Webview2 repaint is omitted sometimes when no debugger is attached #3674

kodfodrasz opened this issue Jul 31, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@kodfodrasz
Copy link

WebView2 does not repaint itself when not attached to a debugger

I have a Vue.JS based PWA that I'd like to display in a native WebView2 window, for some special features provided by webview.

With this app after navigation in the application the window fails to be repainted for the 80% ot the cases, as it seems. Alt-tab for the windows with the WebView2 app back and forth repaints it. When running the app under debugger from Visual Studio it consistently works as expected.

I cannot provide call stacks, or error messages, but can show video recording on a non-public channel, or can produce those if given some pointers of what might be of interest.

Version
SDK: 1.0.1901.177
Runtime: 115.0.1901.188 (64 bits)
Framework: WPF, WinForms (on WinForms the bug happened even when the app was run under the debugger!)
OS: Win10

Regression
Was this working before but has regressed? no

Repro Steps

  1. Spin up the vue PWA application
  2. Start the WebView2 kiosk frame application directly from explorer
  3. Do a navigation to a view by clicking a PWA button
  4. Screen is updated to the relevant content
  5. Do a navigation to a view by clicking a PWA button
  6. Actual Behaviour: BUG: Screen is seemingly not updated to the relevant content (in 80% of the cases). (Expected: Screen is redrawn to show the view which was target of the navigation)
    a. Click on the non-updated screen might cause navigation to views of the application available only from a view where the navigation was successful, suggesting only a repaint was missed
    b. alt-tab back-and forth repaints the window and it can be seen that we are on the desired screen
  7. close the application, and repeat the steps when a debugger is attached to the process
  8. no problems are noticed, all repaints are performed perfectly
@kodfodrasz kodfodrasz added the bug Something isn't working label Jul 31, 2023
@kodfodrasz
Copy link
Author

The problem is present, when the application is full-screen with the following XAML:

<Window x:Class="Kodfodrasz.KioskBrowser.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Kodfodrasz.KioskBrowser"
        xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
        mc:Ignorable="d"
        Title="Kiosk Browser" Height="1024" Width="768"
        Icon="/exva.png"
        WindowStyle="None" ResizeMode="NoResize"  
        WindowStartupLocation="CenterScreen" WindowState="Maximized"
        >
    <DockPanel>
        <wv2:WebView2 Name="webView"
                  Source="http://localhost/"
   />
    </DockPanel>
</Window>

when the WindowState="Maximized" part is omitted, and the application is displayed in a window, everything is working properly, no paints are missed.

@kodfodrasz
Copy link
Author

Sorry for the noise, it seems a GPU driver update did solve this weird issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant