Rollback main window content area click-through behavior

Commit: 6a5aa671 | 2025-09-17 14:46:20+00:00

← Back to List

Rollback main window content area click-through behavior

Moderate
Commit Hash: 6a5aa671542dd29352e2027581aa6bbcd89ceef7
Commit Time: 2025-09-17 14:46:20+00:00
Impact Level: Moderate
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission rolls back the previous change regarding the click-through behavior of the main window content area on macOS. The original change attempted to reduce the restrictions on click-through, especially when the Find bar is active, allowing users to activate the content area with a single click. However, this change broke the inspection behavior in Chrome DevTools and was therefore reverted. After the rollback, the acceptsFirstMouse: method reverts from a complex switch-case implementation (handling cases for the main window, active application, and always accepting clicks based on different values of the AcceptMouseEvents enum) to a simple conditional check (enabling click-through only when the mouse click acceptance option is greater than kWhenInActiveWindow).

🎯 Impact Analysis

This rollback has a moderate level of impact on WebView2Mac. WebView2Mac relies on the RenderWidgetHostViewCocoa class in remote_cocoa to handle mouse events and window interactions. The acceptsFirstMouse: method determines whether the first mouse click is accepted in inactive windows, which directly affects the user interaction experience of the WebView2Mac control. The simplified implementation after the rollback may affect the following scenarios: 1) Click response behavior when WebView2Mac is embedded in a non-main window; 2) Focus switching between WebView2Mac controls in multi-window applications; 3) WebView2Mac’s response to mouse clicks when the host application is not the active application. Although this change will not break the core functionality of WebView2Mac, it may alter its interaction behavior in certain edge cases, especially in scenarios involving window state and mouse event handling.

Impacted Classes:

RenderWidgetHostViewCocoa AcceptMouseEvents