Fix rendering error in macOS 26 manual occlusion detection
Moderate
Commit Hash:
f198a1988d48e62b352176be615e57ab2be04780
Commit Time: 2025-10-14 21:36:36+00:00
Impact Level: Moderate
Generated By: webview2-upstream-sentry
Upstream Review:
View Upstream Review 🔗
📋 Summary
This submission primarily fixes rendering issues with multiple Chrome windows under specific Stage Manager configurations on macOS 26. The main changes include: 1) Updating the version check logic in WebContentsOcclusionCheckerMac to disable manual occlusion detection on macOS 26; 2) Adding version checks in the initialization method of WebContentsViewCocoa, so that the shared instance of WebContentsOcclusionCheckerMac is only created on system versions that support manual occlusion detection; 3) Removing unused header file references. These changes ensure that related instances are not created on system versions that do not support manual occlusion detection, thereby avoiding rendering errors.
🎯 Impact Analysis
This change has a significant positive impact on WebView2Mac. Since WebView2Mac relies on remote_cocoa to depend on WebContentsViewCocoa and WebContentsOcclusionCheckerMac for managing the visibility state of web content, this fix directly affects the rendering stability of WebView2Mac. The specific impacts include: 1) Fixing potential rendering errors on macOS 26 systems, ensuring that the WebView2Mac control can properly display web content; 2) Improving rendering stability in multi-window scenarios, which is particularly important for applications using multiple instances of WebView2Mac; 3) Enhancing system compatibility to ensure that WebView2Mac can reliably operate on the latest versions of macOS. Since occlusion detection directly affects rendering optimization and resource management of web content, this fix has a positive effect on both the performance and stability of WebView2Mac.
Impacted Classes:
WebContentsOcclusionCheckerMac
WebContentsViewCocoa