fix(desktop): boot the main window unthrottled so cold start paints at full speed - #7460
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The desktop app boots its main window hidden (
show: falseuntilready-to-show), and Chromium throttles hidden renderers: timers coalesce to 1s andrequestAnimationFramestops entirely. #7445 removedbackgroundThrottling: falsefrom the main window while fixing hidden preview rendering, which put every cold boot into that throttled state. Claude Desktop shipped the same class of fix last week and measured ~2x faster background starts.The fix keeps both behaviors: the window is created with
backgroundThrottling: falseso boot runs at full speed while hidden, and the first-reveal trigger flips throttling back on. After the window has been shown once, hiding or minimizing it throttles normally, so the #7445 win stays intact.Change made by Claude Fable 5 via Claude Code.
Note
Low Risk
Desktop startup performance tweak with a targeted re-enable on first show; limited to main window webPreferences and covered by new unit tests.
Overview
Fixes slow cold starts caused by Chromium throttling the main renderer while the window stays hidden until
ready-to-show.The main window is created with
backgroundThrottling: falseso timers andrequestAnimationFramerun at full speed during hidden boot. On the first reveal (same path that maximizes and shows the window), the code callssetBackgroundThrottling(true)so afterward hidden or minimized windows throttle normally again—preserving the behavior from the earlier preview fix.Tests expect
webPreferences.backgroundThrottlingto befalseat creation and assertsetBackgroundThrottling(true)runs once whenready-to-showfires.Reviewed by Cursor Bugbot for commit f64bbd5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Boot the main window with
backgroundThrottlingdisabled to improve cold start paint speedSets
webPreferences.backgroundThrottling: falsewhen creating the hidden mainBrowserWindowinDesktopWindow.tsso the renderer runs unthrottled during startup. On the firstready-to-show/did-finish-loadevent,setBackgroundThrottling(true)is called to restore normal hidden-window throttling. Behavioral Change: the main window now boots with throttling disabled by default rather than using Electron's default (enabled).Macroscope summarized f64bbd5.