Repository navigation
Description
What happens
After Settings is closed, its views keep updating every time the bar changes. The work is invisible but runs on the main thread, so the bar's own animations, such as a workspace switch, drop frames, and StableBar uses more CPU at idle until it is relaunched.
Steps to reproduce
- Open Settings and go to Theme.
- Close the window.
- Leave the bar running with widgets that update often (System, Now Playing, Menu bar items), then sample StableBar:
sample <pid> 3.
Expected
A closed Settings window costs nothing. Its views are rebuilt when it opens again.
Environment
- StableBar 0.16.0-beta.20261114170809.1078
- macOS 27.2.1, two displays
- 14 widgets, including System, Now Playing and Menu bar items
Evidence
- A 3-second
sampleof a bar that had been running about 16 hours, with Settings closed:AppearanceView.body(Theme) kept running, and the main thread was idle in only 11 % of samples. 18 % went toNSHostingView.updateWindowContentSizeExtremaIfNecessaryandinvalidateSizeConstraintsIfNecessary, which only a hosting view with the defaultsizingOptionsdoes; the bar's own hosting views set them to[]. - The window list showed
StableBar Settingsstill present, off screen. - After relaunching the bar, with Settings never opened: idle CPU 29 % instead of 37.5 % (10-second averages), and the main thread idle in 58 % of samples instead of 11 %.
Diagnosis
CustomizationWindow.show(store:) (Sources/StableBar/CustomizationWindow.swift, lines 17–48 on main) creates the window once with isReleasedWhenClosed = false and sets its contentView to an NSHostingView of SettingsView. windowWillClose(_:) keeps both, so the hosting view and its SwiftUI graph stay alive, keep observing BarStore and redraw on every change, including the Theme page's bar previews.
Related
- perf: keep Settings responsive while changing the bar #161 kept Settings responsive while the bar changes; it's about Settings while it is open.
- Each workspace switch freezes the bar for about 200 ms, so the switch animation jumps #670: each workspace switch freezes the bar for about 200 ms. This adds to it.
Triaged by Claude Code (Claude Opus 5.5).
Activity
chore(release): 0.16.0 [skip ci]
stablebar-releases commentedon Nov 16, 2026
🎉 This issue has been resolved in version 0.16.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀