microsoft / microsoft/microsoft-ui-xaml

WebView2 hosted via CoreWebView2Controller is non-interactive on Windows 11 but works on Windows 10

Open
#10,826 1 comment 1 reaction 0 assignees View on GitHub
bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

When hosting a WebView2 control in a WinUI 3 application by creating a CoreWebView2Controller and parenting it to the main window's HWND, the control is completely non-interactive on Windows 11. The web content renders correctly, but it does not respond to any mouse clicks, scrolling, or keyboard input. It behaves as if IsHitTestVisible is false, or as if a transparent window is layered on top of it.

This exact same code and application package works perfectly on Windows 10, where the WebView2 is fully interactive.

### Steps to reproduce the bug

Create a new C# WinUI 3 project.

Create a CoreWebView2Environment and then a CreateCoreWebView2ControllerAsync, CoreWebView2Controller attached to the main window's HWND (CoreWebView2ControllerWindowReference.CreateFromWindowHandle).

Set the Bounds of the CoreWebView2Controller and update them on the AppWindow.Changed event.

Navigate the WebView2 to any URL (e.g., https://bing.com).

Run the application on a Windows 10 machine and observe that the webpage is interactive.

Run the exact same application on a Windows 11 machine.

### Actual behavior

_No response_

### Expected behavior

The WebView2 control should be fully interactive on Windows 11, allowing the user to click on links, scroll the page, and type in input fields, just as it does on Windows 10.

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.8.1: 1.8.250916003
Microsoft.Web.WebView2 1.0.3537.50

### Windows version

Windows 11 (24H2): Build 26100
MicrosoftEdgeWebview2 v141.0.3537.71

### Not reproducible in:

Windows 10 Pro (22H2), Build 19045.6332

Contributor guide

Open the contributing guide

Research direction

Start with the minimal C# WinUI 3 reproduction using CoreWebView2Environment, CreateCoreWebView2ControllerAsync, and CoreWebView2ControllerWindowReference.CreateFromWindowHandle. Compare input behavior on Windows 10 and Windows 11 while updating Bounds from AppWindow.Changed. Done means the hosted WebView2 responds to clicks, scrolling, and keyboard input on Windows 11 as it does on Windows 10.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.