Fix the issue of resetting the hit test target when TabTitlebarView is removed in fullscreen mode

提交: 9aac7d8c | 2025-09-08 17:10:00+00:00

← 返回列表

Fix the issue of resetting the hit test target when TabTitlebarView is removed in fullscreen mode

Moderate
提交哈希: 9aac7d8cf1a91ea76760fd621265c36e2e2bac7a
提交时间: 2025-09-08 17:10:00+00:00
影响等级: Moderate
生成工具: webview2-upstream-sentry
上游审核链接: 查看上游审核 🔗

📋 摘要

This submission primarily addresses a race condition issue that occurred when TabTitlebarView was removed from NSToolbarFullScreenWindow in fullscreen mode. Specific changes include: 1) Modified the SetNSNextStepFrameHitTestTargetView function signature, which now accepts separate fullscreen_window and target_view parameters; 2) Added the tabContentView method and improved viewDidMoveToWindow logic in TabTitlebarView; 3) Allowed passing nil as target_view to reset the hit test target. These changes are intended to prevent CHECK failures caused by race conditions between view removal and event dispatch.

🎯 影响分析

The impact of this change on WebView2Mac is moderate. The main effects are as follows: 1) Function signature change: The signature of the SetNSNextStepFrameHitTestTargetView function has undergone an incompatible change. If downstream WebView2Mac code directly calls this function, the invocation method needs to be updated accordingly; 2) Feature enhancement: The new implementation provides better error handling and race condition protection, which benefits the stability of WebView2Mac in fullscreen mode; 3) Interface extension: Allowing nil target_view offers downstream code a more flexible way to manage hit test targets. Since this is a core hit test feature of remote_cocoa, WebView2Mac may need to adapt to these changes if it utilizes related fullscreen mode functionality.

受影响的类:

SetNSNextStepFrameHitTestTargetView TabTitlebarView remote_cocoa::ImmersiveModeTabbedControllerCocoa