Modify the click-through behavior of the main window content area
Minor
Commit Hash:
068d8bb69923f3815e2df90bdd3247820dc22c3c
Commit Time: 2025-09-03 16:34:26+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review:
View Upstream Review 🔗
📋 Summary
This submission modifies the implementation of the acceptsFirstMouse: method in the render_widget_host_view_cocoa.mm file. The original implementation simply checked whether the mouse event acceptance option was greater than kWhenInActiveWindow; now, it uses a switch statement to handle different mouse event acceptance options. The main change is that when the option is kWhenInActiveWindow, special handling for the main window (mainWindow) or key window (keyWindow) has been added to resolve the issue where the content area requires two clicks to respond when the find bar is activated.
🎯 Impact Analysis
This change has a positive impact on WebView2Mac. WebView2Mac uses the render_widget_host_view_cocoa component of Remote Cocoa to handle mouse events and window interactions. The modified acceptsFirstMouse: method improves click-through behavior, especially when the main window or keyboard window is active. This will enhance the user interaction experience with web content in WebView2Mac and reduce unnecessary repeated clicks. Since WebView2Mac relies on Remote Cocoa to manage NSWindow and handle user input events, this improvement will directly benefit WebView2Mac’s window management and event handling mechanisms. This change does not break existing functionality; it simply optimizes the interaction logic.
Impacted Classes:
RenderWidgetHostViewCocoa