[Problem/Bug]: WebView2CompositionControl does not repaint correctly when wrapped in a WPF LayoutTransform (ScaleTransform)
What happened?
Description When using WebView2CompositionControl inside a WPF application and wrapping it in a LayoutTransform (such as ScaleTransform for zooming), the WebView content sometimes becomes stale or only partially rendered.
The issue occurs intermittently — after scaling or layout changes, the web content does not visually update until the user interacts with it (e.g., moving the mouse over an element, clicking, or switching window focus).
It appears that the DirectComposition layer used internally by WebView2CompositionControl is not invalidated or redrawn when the WPF layout transform is applied.
Expected behavior WebView2CompositionControl should repaint its DirectComposition surface when its layout is transformed by WPF, so that the visible content remains correct and up to date.
Actual behavior The rendered content often becomes stale until another UI interaction (like mouse hover, focus change, or window activation) triggers a new frame composition. This does not happen with the standard HWND-based WebView2 control.
Impact This breaks scenarios where apps apply application-level zoom or scaling using LayoutTransform (common for WPF apps that support per-monitor DPI scaling or internal zoom). The only workaround is to avoid LayoutTransform entirely, which removes flexibility in layout and zoom handling.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
141.0.3537.71
SDK Version
1.0.3065.39
Framework
WPF
Operating System
Windows 11
OS Version
No response
Repro steps
- Create a simple WPF window with a WebView2CompositionControl.
- Wrap the control in a LayoutTransform using a ScaleTransform.
- Load a webpage
- Change the ScaleX and ScaleY dynamically (simulating zooming with Ctrl+Mouse wheel).
- Observe that the content sometimes fails to repaint properly — elements appear blurry, frozen, or misaligned.
- Moving the mouse over the page or switching focus forces the content to refresh correctly.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
I use a WebView2Composition control inside a ViewBox and ran into this problem. The usage scenario is for a digital signage software with a dedicated display window (separate application/process) that can be run in two modes:
- Production (WebView2 in a borderless window) --> this is working fine
- Preview/preparation (WebView2Composition in a window that can be resized and moved around) --> this is having problems
Users do not interact with the display window directly, i.e. the window usually does not have the focus. The web application inside the browser receives a message and updates the DOM accordingly. Whenever the WebView2Composition control does not update, simply activating the window by clicking the title bar refreshes the display.