WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: WebView2CompositionControl fails to correctly update visual hosting when moved to a new WPF Window

Open dipsgin opened this issue 3 months ago • 0 comments

What happened?

When using WebView2CompositionControl (visual hosting mode) in a WPF application, the control becomes visually and functionally inconsistent after being moved to a new Window (different HWND) from the one it was originally created in.

Specifically, dropdown menus (

We were able to mitigate this partially by using reflection to manually update CoreWebView2Controller.ParentWindow and recalculate the control’s bounds relative to the new window — but this should ideally be handled internally by WebView2.

Steps to reproduce

  1. Create a WPF app using WebView2CompositionControl.
  2. Initialize the control in the main window (MainWindow).
  3. Move the control instance to a secondary window (for example, a floating tool window).
  4. Open a

Expected behavior When the control is moved to a new parent window, all rendering and popup positioning should remain correct and relative to the new window.

Actual behavior

  • Popups (e.g.,
  • Calling WebView2Controller.NotifyParentWindowPositionChanged() does not fix the issue.
  • The CoreWebView2Controller.Bounds appear to remain based on the original window.

Importance

Blocking. My app's basic functions are not working due to this issue.

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 WPF app using WebView2CompositionControl.
  2. Initialize the control in the main window (MainWindow).
  3. Move the control instance to a secondary window (for example, a floating tool window).
  4. Open a

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

dipsgin avatar Oct 15 '25 07:10 dipsgin