windo: cut idle and hidden CPU/energy use - #4
Merged
Merged
Conversation
- Tint sampler runs only while on-screen, not occluded, not compact, not in page fullscreen. 1 s interval, one snapshot in flight, stale-tab results dropped. Lerp timer runs only until the color converges. - Hide, close button, and minimize pause playing media in all tabs; show resumes the active tab. Tab switch pauses the outgoing tab. New menu toggle "Pause When Hidden" (default on). - Tab bar rebuild coalesced and skipped when unchanged. - Fullscreen state tracked per web view, cleared on navigation. - Opacity save debounced in .common mode; saved on quit. - Tab close removes handlers, delegate, stops loading. - README: hotkey is ⌃⌘H; document Pause When Hidden. Measured (A/B vs main, 4K60 video, % of one core): static 7.5→1.0, playing 34→23.5, hidden 8.1→1.5. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Parked tabs re-pause media that starts after the scan (autoplay-next, SPA nav) via a capture-phase play listener, keep the resume tag until play() actually takes, drop superseded snapshots by generation, and apply the Pause When Hidden toggle while the window is already hidden. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zackbart
commented
Aug 19, 2026
OwnerAuthor
Second-round review (Codex, gpt-5.6-sol) — 6 findings, disposition: Fixed in e33d13a:
Not fixed (known limitations, pre-existing for mute too): Runtime re-check after e33d13a: hidden 15 s → +0 s CPU time for Windo and both WebContent processes; resumes on show. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto 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.
Problem
Windo showed "significant energy" in the battery menu, including while hidden. Hiding did not stop the work: video kept decoding, and the tint sampler (
takeSnapshot3×/s) and a 22 Hz titlebar redraw ran forever while the window was on screen, even when fully covered.Changes
.commonrun-loop mode; saved on quit.Measured (A/B vs
main, Big Buck Bunny 4K60, % of one core, Windo + WebKit helpers)Zero crashes, no new log errors, no timer leak after 30 rapid toggles, tint still tracks the video.
Behavior change
The red close button now hides the window (same as ⌃⌘H) instead of closing it. Matches the hide/show model and
applicationShouldTerminateAfterLastWindowClosed == false.Not tested
True occlusion (window covered) — Windo floats over everything, so it could not be produced. Same code path as minimize, which passed.
powermetricsneeds sudo; skipped.🤖 Generated with Claude Code