fix(menubar): activate before creating the status item, policy pinned (#868) - #955
Merged
Conversation
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.
Ships @ozymandiashh's activate-only fix for #868 (cherry-picked from experiment/868-activate-only, authorship preserved), so the next release carries the best available fix for the never-rendering status item on macOS 26.5.x instead of waiting on the test loop.
The analysis on the issue: 85b5728/db99319's real behavioral change was deleting #147's NSApp.activate call (the policy-setting half was already dead code, since packaged builds ship LSUIElement=true and start at .accessory before main() — measured with a probe bundle). That left the app creating its status item without ever registering with the window server, which is exactly the #146 state. This restores only the activation half, keeping the policy pinned so the .regular -> .accessory transition that plausibly caused the ghost item (the bug 85b5728 fixed) never happens. Second commit corrects the now-disproven comment at the applicationWillFinishLaunching policy call.
Honest framing: neither the analysis author nor this machine reproduces the black icon (renders fine on 26.5.0 and 26.5.2 with 0.9.19), so this is the well-argued middle path that flips neither historical bug, not an evidence-confirmed fix. It is falsifiable by the reporter on the release build either way, and the issue stays open until 25F80 confirms.
Verified: swift build clean, swift test 156/156 green; the healthy-machine case keeps rendering (the activate call is additive for accessory apps, no policy transition occurs).