Skip to content

fix(window): finish first load while minimized - #58

Merged
bercedev merged 1 commit into
masterfrom
fix/background-throttling
Nov 20, 2026
Merged

bercedev merged 1 commit into
masterfrom
fix/background-throttling

Conversation

@bercedev

Copy link
Copy Markdown
Member

problem: if you minimize the window while the page is still loading the first time, chromium throttles the hidden page, so it doesn't paint. on restore you get a flat color for a moment before the page shows up. one user on kde wayland also saw the first song not start.

fix: background throttling is off for the main window until the first media playback (media-started-playing) or 60s, whichever comes first, then it goes back on. it's set up per window in createMainWindow, so a window recreated on macos activate gets it too. the logic is a small helper with tests (play, timer, close, destroyed window, once only). no plugin or ipc needed for the trigger.

numbers (podman, xvfb + openbox, software rendering, minimized right after launch, one core = 100%):

  • throttling always on (before): page doesn't paint while minimized, 8.8% cpu over 60s of playback
  • throttling always off: paints while minimized, but 49.3% cpu and 60 rAF/s the whole time
  • this pr: paints while minimized, trigger fires about 0.9s after minimize, rAF goes to 0 about 2.5s after, 9.6% cpu over 60s

not tested on real wayland or macos. i could not reproduce the "song doesn't start" part, only the missing paint.

used claude code to write this, tested locally in podman

@github-actions

Copy link
Copy Markdown

🚀 Build Artifacts Ready!

The builds have completed successfully. You can download the artifacts from the workflow run:

📦 Download Artifacts

Available builds:

  • Windows: build-artifacts-windows-latest
  • macOS: build-artifacts-macos-latest
  • Linux: build-artifacts-ubuntu-latest

Note: Artifacts are available for 7 days.

@bercedev
bercedev merged commit 0838bf2 into master Nov 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant