Revert the fix for right-click event handling in NSToolbarView

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

← 返回列表

Revert the fix for right-click event handling in NSToolbarView

Minor
提交哈希: 3ff41a90fce7fbd9b1a3d177aab66612079a07c5
提交时间: 2025-08-13 22:44:21+00:00
影响等级: Minor
生成工具: webview2-upstream-sentry
上游审核链接: 查看上游审核 🔗

📋 摘要

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.

🎯 影响分析

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.

受影响的类:

remote_cocoa::ImmersiveModeTabbedControllerCocoa SwizzleNSToolbarViewHitTest