Fix menu bar items on macOS 26.5: XPC peer requirement, image capture, spacing relaunch - #982
Open
keithadler wants to merge 1 commit into
Open
Fix menu bar items on macOS 26.5: XPC peer requirement, image capture, spacing relaunch#982keithadler wants to merge 1 commit into
keithadler wants to merge 1 commit into
Conversation
…, spacing relaunch Three independent problems left the Menu Bar Layout pane, the Ice Bar and search without items or images on macOS 26.5: 1. The app and MenuBarItemService require same-team XPC peers (`.isFromSameTeam()`), which can never be satisfied by ad hoc or self-signed builds because they carry no team identifier. Every sourcePID lookup failed and the item cache never filled. Apply the requirement only when the running process actually has a team identifier (Shared/Utilities/CodeSigning.swift). Signed builds keep the same behavior as before. 2. CGWindowListCreateImageFromArray returns nil for every window on macOS 26.5 (the 26 SDK marks it unavailable), so no item image could be captured and cacheFailed(for:) reported "Unable to display menu bar items". Keep the CGWindowList path first, since it is the only API that can capture offscreen items, and fall back to a ScreenCaptureKit display capture limited to the requested windows' bounds when it returns nil. Offscreen windows are skipped, so hidden items receive their images whenever their section is shown. 3. The item spacing relaunch loop used `break` where it needed `continue`, so every app after Control Center or Ice in the set was silently skipped and never relaunched. Verified on macOS 26.5.2 with an ad hoc build: layout, drag to rearrange, Ice Bar, search and spacing all work again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Three independent problems leave the Menu Bar Layout pane, the Ice Bar and search without items or images on macOS 26.5 (fixes #913, #946, #951; overlaps #950/#953 on the XPC part).
1. Same-team XPC requirement fails on builds without a team identifier
MenuBarItemServiceactivates its listener with.isFromSameTeam()and the app sets the same peer requirement on its session. Ad hoc and self-signed builds carry no team identifier, so the requirement can never be satisfied: everysourcePIDlookup fails and the item cache never fills ("Loading menu bar items…" forever). This applies the requirement only when the running process actually has a team identifier (Shared/Utilities/CodeSigning.swift, checked viaSecCodeCopySigningInformation). Signed builds behave exactly as before.2.
CGWindowListCreateImageFromArrayreturns nil on macOS 26.5The 26 SDK marks the API unavailable and on 26.5 it returns nil for every window, including on-screen ones (verified with a standalone probe), so
cacheFailed(for:)reports "Unable to display menu bar items" everywhere.ScreenCapture.captureWindowskeeps the CGWindowList path first, since it is the only API that can capture offscreen items, and falls back to a ScreenCaptureKit display capture limited to the requested windows' bounds (SCContentFilter(display:including:)+sourceRect). Offscreen windows are skipped, so hidden items receive their images whenever their section is shown; the image cache's merge semantics keep them afterwards. The sync call sites are preserved by running the capture on a detached task with a bounded wait.3. Spacing relaunch loop skips apps
MenuBarItemSpacingManagerusedbreakwhere it neededcontinue, so every app after Control Center or Ice in the PID set was silently skipped and never relaunched.Verified
macOS 26.5.2, ad hoc build: layout shows all items with icons in both sections, drag to rearrange moves items in the menu bar, Ice Bar and search show item images, hotkeys and spacing work.
🤖 Generated with Claude Code