Skip to content

A closed Settings window keeps redrawing with every bar update #671

Closed

Description

@M4n0x

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

  1. Open Settings and go to Theme.
  2. Close the window.
  3. 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 sample of 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 to NSHostingView.updateWindowContentSizeExtremaIfNecessary and invalidateSizeConstraintsIfNecessary, which only a hosting view with the default sizingOptions does; the bar's own hosting views set them to [].
  • The window list showed StableBar Settings still 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

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Nov 15, 2026
  2. stablebar-releases commented on Nov 16, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.16.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions