Repository navigation
fix: MacOS 26 Tahoe - stop overriding private cornerMask API to fix WindowServer GPU load - #48376
Conversation
|
💖 Thanks for opening this pull request! 💖 Semantic PR titlesWe use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of commit messages with semantic prefixes:
Commit signingThis repo enforces commit signatures for all incoming PRs. PR tipsThings that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
… GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path.
|
Tested this and validated the bug from N years ago is no longer present in modern macOS versions (frameless vibrant windows not being rounded) |
VerteDinde
left a comment
There was a problem hiding this comment.
@avarayr Thanks so much for all of your time and effort digging into this issue - I'm sorry for the trouble, the Electron maintainers really appreciate you doing such a deep dive on this fairly complex issue and putting up this fix 🙇♀️
|
Thank you, @avarayr and @fredizzimo, for debugging this and finding a solution! |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
|
Release Notes Persisted
|
…indowServer GPU load (#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path. Co-authored-by: avarayr <7735415+avarayr@users.noreply.github.com>
…indowServer GPU load (#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path. Co-authored-by: avarayr <7735415+avarayr@users.noreply.github.com>
…indowServer GPU load (#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path. Co-authored-by: avarayr <7735415+avarayr@users.noreply.github.com>
|
I have automatically backported this PR to "38-x-y", please check out #48398 |
…indowServer GPU load (electron#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path.
Upgrades Electron from 34.5.1 to 38.6.0 to resolve excessive WindowServer GPU usage on macOS 26 (Sequoia). This issue was caused by Electron's override of the private _cornerMask API, which forced the compositor to treat window masks as dynamic rather than static, resulting in persistent high GPU load. Changes: - Upgrade electron: 34.5.1 → 38.6.0 - Upgrade electron-mksnapshot: 34.5.1 → 38.6.0 - Upgrade @electron/rebuild: ^3.7.1 → ^3.7.2 - Upgrade node-abi: ^3.67.0 → ^3.81.0 (required for Electron 38 support) The fix was introduced in Electron 36.9.2, 37.6.0, 38.2.0, and all later versions. We're upgrading to 38.6.0 as it's the latest stable version compatible with Node 20.11.0. Fixes: electron/electron#48376
…indowServer GPU load (electron#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path.
…indowServer GPU load (electron#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path.
…indowServer GPU load (electron#48376) fix: macOS stop overriding private cornerMask API to fix WindowServer GPU load spike Electron fetched a custom `_cornerMask` for `ElectronNSWindow` to smooth vibrancy corners. On macOS 15 (Tahoe) that private hook forces the window shadow to be rendered from a fully transparent surface, causing the WindowServer GPU load regression. Remove the `cornerMask` property and the `_cornerMask` override so we stay on Apple’s default shadow path.
* Fix macOS 26 GPU performance issue by upgrading to Electron 38 Upgrades Electron from 34.5.1 to 38.6.0 to resolve excessive WindowServer GPU usage on macOS 26 (Sequoia). This issue was caused by Electron's override of the private _cornerMask API, which forced the compositor to treat window masks as dynamic rather than static, resulting in persistent high GPU load. Changes: - Upgrade electron: 34.5.1 → 38.6.0 - Upgrade electron-mksnapshot: 34.5.1 → 38.6.0 - Upgrade @electron/rebuild: ^3.7.1 → ^3.7.2 - Upgrade node-abi: ^3.67.0 → ^3.81.0 (required for Electron 38 support) The fix was introduced in Electron 36.9.2, 37.6.0, 38.2.0, and all later versions. We're upgrading to 38.6.0 as it's the latest stable version compatible with Node 20.11.0. Fixes: electron/electron#48376 * Use optional chaining Signed-off-by: Philip Peterson <1326208+philip-peterson@users.noreply.github.com> --------- Signed-off-by: Philip Peterson <1326208+philip-peterson@users.noreply.github.com> Co-authored-by: Philip Peterson <1326208+philip-peterson@users.noreply.github.com>
Nexu 0.1.7 (Electron 37.10.3) fails to launch on macOS 26.1 Tahoe — process spawns but immediately exits with status 0, no window appears (#649). Electron 37.x has multiple known macOS 26 issues: - Launch crash / EXC_BREAKPOINT during ElectronMain init (electron/electron#49522) - WindowServer GPU perf regression from private _cornerMask API override (electron/electron#48311, fixed in electron/electron#48376) Upgrades from ^37.2.5 to ^38.2.0 (resolves to 38.8.6), which includes all macOS Tahoe fixes. Breaking changes from 37→38 are all benign for this macOS-focused app: - macOS 11 (Big Sur) dropped (we target recent macOS) - Wayland/GTK changes (Linux only, not relevant) - isAeroGlassEnabled removed (Windows only, unused) Closes #649 https://claude.ai/code/session_014T4ZxuSuZriSHC65C15dsi
…GPU pegging On macOS 26 Tahoe, AppKit decides whether to share the window corner-mask cache via a method-identity check. Any NSWindow subclass that directly overrides the private `_cornerMask` selector is treated as custom, which disables the cache and forces WindowServer to re-render every frame — showing up as sustained 60–100% WindowServer CPU and global UI lag. Easydict's own window subclasses don't override `_cornerMask`, but several private system/SwiftUI subclasses loaded in-process do (verified via runtime scan): `_NSTextFinderOverlayWindow`, `SwiftUISuggestionsWindow`, `QLBubbleWindow`, `QLPreviewPanel`, `IKPictureTaker`. Walk the runtime class list once at startup (before SwiftUI creates any window), find every NSWindow subclass that directly defines `_cornerMask`, and reset its IMP to NSWindow's default. This restores the shared cache path and matches the upstream Electron fix in electron/electron#48376. Refs: electron/electron#48311
Description of Change
fixes: #48311
_cornerMaskselector inElectronNSWindowcornerMaskplumbing that applied a custom mask image to vibrant viewsRationale:
Backwards-compat concerns:
I see no reason to override
_cornerMaskas the corner radius masking is already covered byNSVisualEffectViewsetMaskImage, rendering NO visual difference without_cornerMaskoverride + vibrancyChecklist
npm testpassesRelease Notes
Notes: Fixed excessive WindowServer GPU usage on macOS Tahoe 26.