Dock icon stays after launch on macOS 27.0: accessory demotion silently fails
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- macos, swift
- Domain
- desktop, operating-systems
Research direction
Start in Sources/CodexBar/DockIconController.swift, especially shouldPromoteForPresentedWindow, and reproduce the launch path with CODEXBAR_STATUS_ITEM_DIAGNOSTICS=1 on macOS 27.0. Check whether the empty SwiftUI Settings placeholder is counted as presented during startup. Done means launching and relaunching CodexBar no longer leaves a Dock icon when no usable Settings window is shown.
Written by the indexing model from the issue text.
Description
CodexBar shows up in the Dock on every launch since I'm on macOS 27.0 (26A428), and it stays there. CodexBar 0.68.0 (159), installed in /Applications, LSUIElement is true and LaunchServices has it registered as ui-element.
It happens on a clean quit and relaunch, not only after a Sparkle update. Polling NSWorkspace.runningApplications from a separate process right after open -a CodexBar:
0.53s policy=1 (accessory)
0.67s policy=0 (regular, Dock icon appears)
... stays 0 for the rest of the 40s poll
With CODEXBAR_STATUS_ITEM_DIAGNOSTICS=1, the startup trace reports activationPolicy: 1 on every line from will-finish-launching to startup-check, while lsappinfo reports the process as type="Foreground". The SwiftUI Settings placeholder ({{840, 580}, {900, 450}}) is visible: true from did-finish-launching through rendered, and false at startup-check.
So my reading is: the visible placeholder qualifies for promotion in shouldPromoteForPresentedWindow, the app goes .regular, and the later setActivationPolicy(.accessory) doesn't take effect.
That last part looks like an OS bug rather than CodexBar's logic. A minimal AppKit app with LSUIElement = true reproduces it on 27.0:
func applicationDidFinishLaunching(_ n: Notification) {
NSApp.setActivationPolicy(.regular) // returns true, Dock icon appears
print(NSApp.activationPolicy().rawValue) // still prints 1 (accessory)
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
print(NSApp.setActivationPolicy(.accessory)) // false, Dock icon stays
}
}
The in-process getter never leaves .accessory, and the switch back to .accessory returns false. I also tried re-setting .regular first, calling NSApp.activate first, and going through .prohibited (with and without a delay). .prohibited takes effect, but .accessory never does. Peekaboo shows the same symptom for the same reason. I haven't compared against an older macOS, so I can't say for sure it's new in 27.0, but it only started for me after updating.
Since the demotion can't be relied on, avoiding the promotion in the first place would sidestep it. For example, not counting the empty SwiftUI Settings placeholder as a presented Settings window at launch. Happy to test a build if that helps.
- Dominant language
- Swift
- Stars
- 21.9k
- Forks
- 2k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 438
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from steipete/CodexBar
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
steipete/CodexBar#3349 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🌊 off-meta tidepool P3
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
steipete/CodexBar#2860 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr impact:auth-provider impact:security issue-rating: 🌊 off-meta tidepool P2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
steipete/CodexBar#2429 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in steipete/CodexBar
Similar issues
-
area: agents area: cli bug difficulty:2 help wanted S3: minor
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
manaflow-ai/cmux#15718 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mozilla-mobile/firefox-ios#35850 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
appandflow/stim#1941 ·
Maintainers usually reply within 1 day
-
product / avatars product / self-hosted product / storage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
appwrite/appwrite#13985 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day