Revert "Mac: Use permanent thin controller for macOS 13+" feature
Moderate
提交哈希:
812d1901a19e4247be596d2700126ebec4f1cd07
提交时间: 2025-03-05 21:33:06+00:00
影响等级: Moderate
生成工具: webview2-upstream-sentry
上游审核链接:
查看上游审核 🔗
📋 摘要
This submission rolls back the previous change that "always keeps the thin titlebar accessory view controller present on macOS 13+." The original change aimed to address the race condition issue of the titlebar accessory view controller in PWA fullscreen mode, but caused a severe regression where the toolbar failed to render on macOS 11 and 12. This rollback restores the old logic, i.e., dynamically inserting and removing the thin controller only when needed, and uses a FeatureFlag (kFullscreenPermanentThinController) to control the switch between the new and old logic. Conditional logic adjustments and feature flag declarations are made in files related to remote_cocoa, including browser_native_widget_window_mac.mm, immersive_mode_controller_cocoa.{h,mm}, and features.{h,cc}.
🎯 影响分析
The impact on WebView2Mac is mainly reflected in fullscreen window management and the handling of the titlebar accessory view controller. Since WebView2Mac relies on remote_cocoa for window bridging and fullscreen implementation, changes in the timing of thin controller insertion/removal may affect the consistency of fullscreen behavior on macOS 13+. This rollback restores the previous on-demand insertion logic, which theoretically improves compatibility with macOS 11/12 and reduces risks such as toolbar loss, but may also cause the PWA fullscreen race condition issue to reappear on macOS 13+. For WebView2Mac, if downstream does not enable the kFullscreenPermanentThinController feature, behavior remains consistent with pre-rollback and risk is low; if downstream has customized fullscreen flows or depends on this feature, attention should be paid to the lifecycle management of the fullscreen window accessory view. Overall, this change does not break the core functionality of WebView2Mac, but it is recommended to monitor fullscreen-related UI detail performance.
受影响的类:
remote_cocoa::NativeWidgetNSWindowBridge
remote_cocoa::ImmersiveModeControllerCocoa
remote_cocoa::features(kFullscreenPermanentThinController)
BrowserNativeWidgetWindowMac