avarayr

#48376: fix: MacOS 26 Tahoe - stop overriding private cornerMask API to fix WindowServer GPU load

Merged
Created: Sep 24, 2025, 11:58:29 PM
Merged: Sep 26, 2025, 2:41:17 PM
19 comments
Target: main

Description of Change

fixes: #48311

  • stop overriding the private _cornerMask selector in ElectronNSWindow
  • 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

Release Notes

Notes: Fixed excessive WindowServer GPU usage on macOS Tahoe 26.

Backports

36-x-y
Merged
PR Number
#48401
Merged At
Sep 27, 2025, 12:35:12 PM
Released In
v36.9.2
Release Date
Sep 27, 2025, 12:37:21 PM
37-x-y
Merged
PR Number
#48400
Merged At
Sep 27, 2025, 12:30:52 PM
Released In
v37.6.0
Release Date
Sep 27, 2025, 12:41:17 PM
38-x-y
Merged
PR Number
#48398
Merged At
Sep 27, 2025, 6:16:33 PM
Released In
v38.2.0
Release Date
Sep 27, 2025, 6:20:08 PM
39-x-y
Merged
PR Number
#48399
Merged At
Sep 27, 2025, 12:30:18 PM
Released In
v39.0.0-alpha.7
Release Date
Sep 27, 2025, 4:55:39 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

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