Skip to content

Commit 3a7c6dd

Browse files
authored
fix: MacOS 26 Tahoe - stop overriding private cornerMask API to fix WindowServer 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.
1 parent 26e886c commit 3a7c6dd

File tree

3 files changed

+0
-15
lines changed

3 files changed

+0
-15
lines changed

shell/browser/native_window_mac.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,6 @@ static bool FromV8(v8::Isolate* isolate,
13331333
maskImage.capInsets = NSEdgeInsetsMake(radius, radius, radius, radius);
13341334
maskImage.resizingMode = NSImageResizingModeStretch;
13351335
[vibrantView setMaskImage:maskImage];
1336-
[window_ setCornerMask:maskImage];
13371336
}
13381337
}
13391338
}

shell/browser/ui/cocoa/electron_ns_window.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ class ElectronNativeWindowObserver;
4040
@property BOOL disableAutoHideCursor;
4141
@property BOOL disableKeyOrMainWindow;
4242
@property(nonatomic, retain) NSVisualEffectView* vibrantView;
43-
@property(nonatomic, retain) NSImage* cornerMask;
4443
- (id)initWithShell:(electron::NativeWindowMac*)shell
4544
styleMask:(NSUInteger)styleMask;
4645
- (void)cleanup;
4746
- (electron::NativeWindowMac*)shell;
4847
- (id)accessibilityFocusedUIElement;
4948
- (NSRect)originalContentRectForFrameRect:(NSRect)frameRect;
5049
- (BOOL)toggleFullScreenMode:(id)sender;
51-
- (NSImage*)_cornerMask;
5250
- (void)disableHeadlessMode;
5351
@end
5452

shell/browser/ui/cocoa/electron_ns_window.mm

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
} // namespace electron
2626

2727
@interface NSWindow (PrivateAPI)
28-
- (NSImage*)_cornerMask;
2928
- (int64_t)_resizeDirectionForMouseLocation:(CGPoint)location;
3029
@end
3130

@@ -123,7 +122,6 @@ @implementation ElectronNSWindow
123122
@synthesize disableAutoHideCursor;
124123
@synthesize disableKeyOrMainWindow;
125124
@synthesize vibrantView;
126-
@synthesize cornerMask;
127125

128126
- (id)initWithShell:(electron::NativeWindowMac*)shell
129127
styleMask:(NSUInteger)styleMask {
@@ -308,16 +306,6 @@ - (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item {
308306
return [super validateUserInterfaceItem:item];
309307
}
310308

311-
// By overriding this built-in method the corners of the vibrant view (if set)
312-
// will be smooth.
313-
- (NSImage*)_cornerMask {
314-
if (self.vibrantView != nil) {
315-
return [self cornerMask];
316-
} else {
317-
return [super _cornerMask];
318-
}
319-
}
320-
321309
- (void)disableHeadlessMode {
322310
if (shell_) {
323311
// We initialize the window in headless mode to allow painting before it is

0 commit comments

Comments
 (0)