Repository navigation
fix(app): stop drawing windows that are closed or hidden - #102
Merged
Merged
Conversation
A closed dashboard kept its views alive, and their looping animations (pulsing dots, moving power lines) and rolling numbers went on drawing it off screen. The app sat at around half a CPU core with no window open, and the same work on the main thread made scrolling lag. Closing the dashboard or the setup window now drops its contents. The looping animations run from a 30 fps clock that pauses while the window is hidden, covered or behind another app, and numbers roll only while the window is on screen. The menu bar item reads a small value that changes only when its ring or percentage does, instead of redrawing every second, and pointing at a card redraws only its light. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
3 tasks done
yogeshprasad098
added a commit
that referenced
this pull request
Nov 27, 2026
A closed dashboard kept its views alive, and their looping animations (pulsing dots, moving power lines) and rolling numbers went on drawing it off screen. The app sat at around half a CPU core with no window open, and the same work on the main thread made scrolling lag. Closing the dashboard or the setup window now drops its contents. The looping animations run from a 30 fps clock that pauses while the window is hidden, covered or behind another app, and numbers roll only while the window is on screen. The menu bar item reads a small value that changes only when its ring or percentage does, instead of redrawing every second, and pointing at a card redraws only its light.
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 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.
A closed dashboard kept its views alive, and their looping animations and rolling numbers went on drawing it off screen. The installed 0.3.0 sat at 45–55% CPU with no window open, and the same work on the main thread made scrolling lag. This drops a closed window's contents, pauses the looping animations while a window is hidden, covered or behind another app, stops the menu bar item redrawing every second, and keeps the cards' pointer light from redrawing their contents.
Review focus
WindowContentdecides when a window counts as open:willClosedrops the contents, and an occlusion change on a visible window brings them back. The menu bar panel keeps its contents (it sizes itself to them) and only getsisOnScreen. The power lines' glow is now a soft static line under the dashes instead of a shadow that was blurred again every frame.Testing
Tested:
./scripts/check.shpasses except lint, which is off. I measured debug builds started with--demousingtop, before and after, sampling for 8 s after letting each state settle:Memory with the window closed went from 87 MB to 61 MB. I closed and reopened the dashboard and it came back with its contents. Design renders of Overview in light and dark look the same apart from the wire glow.
Not tested: the release build with live readings. Demo mode has no once-a-second updates, so the real app's numbers need checking after an update. I didn't measure scrolling frame times; Instruments isn't scriptable here.
CHANGELOG.mdhas an entry under Unreleased, or nothing user-visible changed.!in the title and the migration above.Notes
sampleon the installed app showed the main thread about 80% busy inCA::Transaction::flush: an interpolated (animating) display list drawn in software throughCGDrawingLayer, plusNSHostingView.layoutevery frame.OverviewPage.bodyandChargerStrip.bodywere in the stacks with no window on screen.