Adapt window control alignment and corner radius adjustments for macOS 26

Commit: 7219e0d8 | 2025-07-14 20:38:21+00:00

← Back to List

Adapt window control alignment and corner radius adjustments for macOS 26

Moderate
Commit Hash: 7219e0d8b94399feeba50fa5b23d942fc6d113f2
Commit Time: 2025-07-14 20:38:21+00:00
Impact Level: Moderate
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission mainly targets the macOS 26 system, adjusting the alignment and corner radius strategy for window controls (such as title bar buttons/traffic lights). Specifically, on macOS 26, the left inset and corner radius of window controls are overridden via private interfaces, ensuring the controls’ positions and window corners remain concentric, and the tab bar spacing is fine-tuned to optimize visual effects. For systems below macOS 26, the original control alignment and layout logic remain unchanged. This change involves the BrowserWindowFrame class in remote_cocoa, with new and overridden methods such as _minXTitlebarWidgetInset and _getCachedWindowCornerRadius, and retains compatibility handling for immersive fullscreen in the _titlebarHeight logic.

🎯 Impact Analysis

The impact of this change on WebView2Mac is mainly reflected in the alignment and corner radius appearance of window controls (such as close, minimize, and zoom buttons) on macOS 26. Since WebView2Mac inherits and reuses remote_cocoa::NativeWidgetNSWindowBridge and its related window bridging logic, and the layout and corner radius parameters of window controls are typically managed upstream by remote_cocoa, this change will directly affect the window appearance and user experience of WebView2Mac on macOS 26. Specific impacts include:
1. If WebView2Mac uses NativeWidgetNSWindowBridge or its derived classes (such as HostingNSWindowBridge), the alignment and corner radius of window controls will automatically adapt to the new macOS 26 policy, with no need for additional downstream adaptation.
2. If there are custom window control layouts or overrides of related private interfaces downstream, compatibility with the new parameters (such as an inset of 13.0 and a corner radius of 20.0) must be ensured.
3. Compatibility with immersive fullscreen mode remains unchanged and will not compromise the fullscreen experience of WebView2Mac.
4. This change does not affect core functionalities such as Mojo interfaces or window lifecycle management; it only impacts window appearance and certain layout details.
Overall, this change is a compatibility update at the appearance and detail level, with no destructive impact on functionality. However, downstream should pay attention to the visual presentation of window controls on macOS 26 and perform UI verification if necessary.

Impacted Classes:

NativeWidgetNSWindowBridge BrowserWindowFrame HostingNSWindowBridge(如下游继承自上游该类) remote_cocoa::NativeWidgetNSWindowHostHelper(间接受影响) remote_cocoa::mojom::NativeWidgetNSWindow(窗口布局相关接口)