#48376: fix: MacOS 26 Tahoe - stop overriding private cornerMask API to fix WindowServer GPU load
Description of Change
fixes: #48311
- stop overriding the private
_cornerMask
selector inElectronNSWindow
- remove the
cornerMask
plumbing that applied a custom mask image to vibrant views - rely on AppKit’s default shadow rendering, which fixes the WindowServer GPU spike on macOS 26 Tahoe when shadows are enabled
Rationale:
If AppKit uses method implementation identity to decide whether the window mask is static, then a subclass override (even if it calls super) will change that identity and force the compositor to treat the mask as dynamic.
Method-IMP sentinel check
AppKit asks: “is _cornerMask implemented by the standard theme frame?” via
class_getMethodImplementation
/method_getImplementation.
If yes → treat masks as canonical and use a shared cache keyed by class/selector;
if no → mark mask as custom and re-render per-window. → persistent high GPU load
Backwards-compat concerns:
I see no reason to override _cornerMask
as the corner radius masking is already covered by NSVisualEffectView
setMaskImage
, rendering NO visual difference without _cornerMask
override + vibrancy
Checklist
- PR description included and stakeholders cc'd
-
npm test
passes - tests are changed or added
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, and past tense.
Release Notes
Notes: Fixed excessive WindowServer GPU usage on macOS Tahoe 26.
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron