Modification of Click-Through Behavior in Main Window Content Area
Moderate
提交哈希:
e49235e02ceb0737df2aa19ef0fa1069cd0810cd
提交时间: 2025-09-18 18:16:36+00:00
影响等级: Moderate
生成工具: webview2-upstream-sentry
上游审核链接:
查看上游审核 🔗
📋 摘要
This submission modifies the implementation of the acceptsFirstMouse: method in RenderWidgetHostViewCocoa on macOS. The previous simple conditional logic has been replaced with a more detailed switch statement, providing different click handling strategies for various AcceptMouseEvents options. The main changes include: when acceptsMouseEventsOption is kWhenInActiveWindow, it now accepts the first click for either the mainWindow or keyWindow; for the kWhenInActiveApp and kAlways options, it directly returns YES. This change is primarily intended to resolve the issue where, when the find bar is active, the content area requires two clicks to pass the event to the page.
🎯 影响分析
This change directly affects the handling behavior of mouse click events in WebView2Mac. The specific impacts include: 1) When the WebView2Mac window is the main window or key window, the first click will be directly accepted and passed to the web content, altering the original double-click activation behavior; 2) This may affect the interaction patterns of the user interface in WebView2Mac applications, especially the behavior when secondary UI elements (such as the find bar) become the key window; 3) For WebView2Mac instances using the default AcceptMouseEvents::kWhenInActiveWindow option, the user experience will change, and it will no longer be necessary to activate the window before interacting with the content; 4) If there are downstream custom implementations of acceptsMouseEventsOption in WebView2Mac, their behavior will also change accordingly. This change improves the directness of user interaction, but may also break application logic that relies on the original double-click activation mode.
受影响的类:
RenderWidgetHostViewCocoa
RenderWidgetHostViewMacDelegate
AcceptMouseEvents