Skip to content

[Bug]: Display-change recovery retry loop corrupts Control Center and confuses menu bar managers #1175

@diazdesandi

Description

@diazdesandi

Hi, coming from https://github.com/stonerl/Thaw

Summary

When a display configuration change occurs (monitor connected/disconnected,
resolution changed) while CodexBar's status item is hidden by a menu bar
manager (Bartender, Ice, Hidden Bar, etc.), CodexBar can destroy and recreate
its NSStatusItem up to four times in rapid succession. Each recreation is
visible to the system as a brand-new status item, which corrupts Control
Center's internal layout and causes menu bar managers to lose track of or
re-expose the previously hidden item.

We discovered this issue while testing for the release of Thaw 2.0.0 beta 13. CodexBar corrupted the Control Center files and broke the app functionality itself. By looking at the logs, it was discovered that there were issues happening with CodexBar. We are working on a way to handle them from our side. If the build with issues is required, we can provide it. We also have multiple logs files and we can run a live test if required.

Environment

  • CodexBar: /0.29.x
  • macOS: 26.5
  • Menu bar manager: Thaw

Expected behavior

On a display configuration change, CodexBar refreshes or recreates its status
item once if recovery is needed, then stops — leaving menu bar managers free
to manage its position without interference.

Actual behavior

The verifyScreenChangeRecoveryIfNeeded method introduced a retry loop in
commit c305858 ("fix: retry menu bar display recovery"). After the initial
recreateStatusItemsForVisibilityRecovery() call, the loop reschedules itself
up to three more times (2 s apart). When a menu bar manager re-parks or
re-hides the newly recreated item, the item can temporarily appear blocked
(hasWindow: false or buttonWidth: 0) before the manager completes its own
bookkeeping. Each such appearance triggers another recreation cycle, for up to
four total NSStatusItem destructions per display event.

Reproduction

  1. Install Thaw and hide CodexBar's icon in its
    overflow section.
  2. Run CodexBar.
  3. Trigger a menu bar change
  4. Observe Control Center icons shift or glitch, and Thaw re-exposing CodexBar
    as if it were a new unknown item.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions