Revert the fix for right-click event handling in NSToolbarView

Commit: 3ff41a90 | 2025-08-13 22:44:21+00:00

← Back to List

Revert the fix for right-click event handling in NSToolbarView

Minor
Commit Hash: 3ff41a90fce7fbd9b1a3d177aab66612079a07c5
Commit Time: 2025-08-13 22:44:21+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission rolls back a fix for the right-click event handling issue in NSToolbarView on macOS 26. The reverted code includes the deletion of the swizzle_ns_toolbar_view_hit_test.h and swizzle_ns_toolbar_view_hit_test.mm files, which previously used swizzling of internal AppKit methods to address the problem where right-clicking the horizontal tab bar in fullscreen mode failed to trigger the context menu. Additionally, the invocation of the SwizzleNSToolbarViewHitTest() function has been removed from immersive_mode_tabbed_controller_cocoa.mm. This rollback was performed because the original fix caused high-confidence crash issues.

🎯 Impact Analysis

The impact of this rollback on WebView2Mac is relatively minor. The deleted code was specifically used to address right-click event routing issues in the browser tab bar, mainly affecting tab bar interactions in immersive fullscreen mode. As an embedded web control, WebView2Mac typically does not involve complex tab bar management, so it will not be directly affected by this particular fix. However, if WebView2Mac uses similar NSToolbarView components or relies on related event handling mechanisms in immersive fullscreen mode, it may be indirectly impacted. The rollback may reintroduce right-click event routing issues on macOS 26, but this primarily affects tabbed browser interfaces rather than the core embedded functionality of WebView2Mac.

Impacted Classes:

remote_cocoa::ImmersiveModeTabbedControllerCocoa SwizzleNSToolbarViewHitTest