Skip to content

fix: stabilize menu-bar icon on macOS 26 - #5

Open
g150446 wants to merge 1 commit into
Aboudjem:mainfrom
g150446:fix/menu-bar-icon-stability
Open

g150446 wants to merge 1 commit into
Aboudjem:mainfrom
g150446:fix/menu-bar-icon-stability

Conversation

@g150446

@g150446 g150446 commented Jul 19, 2026

Copy link
Copy Markdown

Summary

This PR makes the menu-bar status item more stable on macOS 26 by:

  1. Rendering all three glyph states into the same natural-size canvas so the status slot width never changes when toggling between off / on / armed.
  2. Using a square-length status item with an explicit autosaveName and isVisible = true.
  3. Recreating the status item automatically if its backing button becomes nil.
  4. Replacing the layer-based pulse animation with an AppKit animator proxy to avoid touching NSStatusBarButton's layer, which can destabilize status items on newer macOS.

Related

Tested

  • Built with ./build.sh
  • App launches and runs without crashing
  • Status item is correctly created with a valid image and button

jxz345 added a commit to jxz345/Sleepless that referenced this pull request Oct 7, 2026
Render all glyph states into one fixed canvas, use a square status-item
slot with an autosave name, recreate the item if its button goes nil, and
pulse via the AppKit animator instead of the button's CALayer. Unlike Aboudjem#5,
isVisible is not forced on every poll, so hiding the icon in System
Settings is respected.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icon disappear right after I run the app

1 participant