MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: WebView2CompositionControl does not repaint correctly when wrapped in a WPF LayoutTransform (ScaleTransform)

Open
#5,400 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

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
  1. Create a simple WPF window with a WebView2CompositionControl.
  2. Wrap the control in a LayoutTransform using a ScaleTransform.
  3. Load a webpage
  4. Change the ScaleX and ScaleY dynamically (simulating zooming with Ctrl+Mouse wheel).
  5. Observe that the content sometimes fails to repaint properly — elements appear blurry, frozen, or misaligned.
  6. 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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WPF reproduction described in the issue: create a WebView2CompositionControl, apply a LayoutTransform with ScaleTransform, and change ScaleX and ScaleY dynamically. Observe whether the DirectComposition surface repaints without mouse, focus, or window-activation interaction. Done means transformed WebView content remains current and correctly rendered after each layout change.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.