Fix: Disable window shadows on macOS Tahoe to prevent GPU performance issues (#267724)

* fix: disable window shadows on macOS Tahoe to prevent GPU performance issues

Fixes #267022

macOS Darwin 25.x (Tahoe) has a WindowServer bug that causes windows with
shadows to consume 80%+ GPU resources. This change disables window shadows
specifically for Darwin 25.x to work around the performance regression.

The fix is applied in defaultBrowserWindowOptions to ensure all VSCode
windows are affected consistently.

* chore: clarify comment

* chore: cleanup

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
avarayr
2025-09-24 13:27:16 -04:00
committed by GitHub
parent 4d9f9a62fb
commit e278d3a668
2 changed files with 14 additions and 1 deletions

View File

@@ -278,3 +278,7 @@ export const isAndroid = !!(userAgent && userAgent.indexOf('Android') >= 0);
export function isBigSurOrNewer(osVersion: string): boolean {
return parseFloat(osVersion) >= 20;
}
export function isTahoe(osVersion: string): boolean {
return parseFloat(osVersion) === 25;
}

View File

@@ -4,10 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import electron, { Display, Rectangle } from 'electron';
import { release } from 'os';
import { Color } from '../../../base/common/color.js';
import { Event } from '../../../base/common/event.js';
import { join } from '../../../base/common/path.js';
import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from '../../../base/common/platform.js';
import { IProcessEnvironment, isLinux, isMacintosh, isTahoe, isWindows } from '../../../base/common/platform.js';
import { URI } from '../../../base/common/uri.js';
import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js';
import { IConfigurationService } from '../../configuration/common/configuration.js';
@@ -186,6 +187,14 @@ export function defaultBrowserWindowOptions(accessor: ServicesAccessor, windowSt
if (windowSettings?.clickThroughInactive === false) {
options.acceptFirstMouse = false;
}
// Mac OS 26.?.? has a `WindowServer` bug that causes (some?) windows with shadows
// to cause 80%+ GPU load.
// See: https://github.com/electron/electron/issues/48311
// TODO: once the bug is fixed in the OS, lock this into a specific version.
if (isTahoe(release())) {
options.hasShadow = false;
}
}
if (overrides?.disableFullscreen) {