-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Fix: Disable window shadows on macOS Tahoe to prevent GPU performance issues #267724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Disable window shadows on macOS Tahoe to prevent GPU performance issues #267724
Conversation
… issues Fixes microsoft#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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes severe GPU performance issues on macOS Tahoe (Darwin 26) by disabling window shadows as a workaround for a WindowServer bug that causes 80%+ GPU usage.
- Adds OS version detection to identify affected macOS versions
- Disables window shadows specifically for Darwin 25.x systems
- Centralizes the fix in
defaultBrowserWindowOptionsto affect all VS Code windows
| options.acceptFirstMouse = false; | ||
| } | ||
|
|
||
| // Mac OS 26.?.? has a `WindowServer` bug that causes windows with shadows to cause 80%+ GPU load |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment incorrectly states 'Mac OS 26.?.?' but the code checks for osMajorVersion === 25. According to the PR description, the issue affects Darwin 26 (Tahoe), but the version check targets Darwin 25. This mismatch needs to be corrected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.release() returns the kernel version 25.0.0, which is not the same as the marketing version - Mac OS 26.0
Since this bug is most likely in windowserver, which is a userland program, the underlying issue is likely to be fixed with a patch update to the OS version, whereas the kernel version will remain the same 25.0.0
Question: Since this is potentially unreliable, but short of running sw_vers -productVersion there is no other option, is it worth to add a check with sw_vers -productVersion for this?
| const [osMajorVersion, _osMinorVersion, _osPatchVersion] = release().split('.', 3).map(Number); | ||
|
|
||
| // In the future: once the bug is fixed in the OS, lock this into a specific version | ||
| if (osMajorVersion === 25) { |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version check targets Darwin 25, but according to the PR description and title, the issue affects macOS Tahoe which is Darwin 26. The condition should be osMajorVersion === 26 to match the intended target version.
| if (osMajorVersion === 25) { | |
| if (osMajorVersion === 26) { |
|
is it possible to disable this via settings by any chance for existing builds? |
✅ UPDATE — BETTER WORKAROUND ¹launchctl setenv CHROME_HEADLESS 1restart electron apps (this will not survive computer reboots!) ¹ Why this works — chromium source code
|
This is probably off-topic, but is there a solution like this for Discord? It uses an app.asar file. |
you are god, my battery loves you |
|
@f0rr0 You may be able to use the "Custom UI" extension (or anything like it) to remove window shadows/window decorations. Alternatively, I think you can just fullscreen your vscode (cmd+ctrl+f) and the GPU usage issue should no longer occur |
|
For the lazy copy/paste people like myself, here's the command for VS Code Insiders: sed -i '' 's/experimentalDarkMode:!0}/experimentalDarkMode:!0,hasShadow:false}/g' /Applications/Visual\ Studio\ Code\ -\ Insiders.app/Contents/Resources/app/out/main.js |
deepak1556
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for investigating the bug in upstream and creating this PR!
Thank you from Perú 🇵🇪 |
|
@jorgegarba this is fixed in the latest vs code release. Also, I'm not sure if Apple has changed anything about this issue in particular but I'm having far fewer problems in macos 26.1 beta. |
TY sir!, Actually I have the latest version about VScode, yesterday night my laptop was burning, with this line today morning , I started the work and so far it is stable 😃 |
Summary
Fixes #267022
Fixes #267065
related: electron/electron#48311
macOS Darwin 26 (Tahoe) has a WindowServer bug that causes (some?) windows with shadows to consume 80%+ GPU resources. This change disables VSCode window shadows specifically for Darwin 25.x to work around the performance regression.
Changes
defaultBrowserWindowOptionsto detect Darwin 25.xoptions.hasShadow = falseonly on affected macOS versionsTesting
Notes
This is a temporary workaround until Apple fixes the underlying WindowServer bug in macOS Tahoe. The version check can be refined or removed once the OS-level issue is resolved.