Rollback main window content area click-through behavior

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

← 返回列表

Rollback main window content area click-through behavior

Moderate
提交哈希: 6a5aa671542dd29352e2027581aa6bbcd89ceef7
提交时间: 2025-09-17 14:46:20+00:00
影响等级: Moderate
生成工具: webview2-upstream-sentry
上游审核链接: 查看上游审核 🔗

📋 摘要

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).

🎯 影响分析

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.

受影响的类:

RenderWidgetHostViewCocoa AcceptMouseEvents