Skip to content

fix: show the right icons in the Menu bar items row - #325

Merged
M4n0x merged 1 commit into
mainfrom
fix/menu-bar-items-icons
Oct 26, 2026
Merged

M4n0x merged 1 commit into
mainfrom
fix/menu-bar-items-icons

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The Menu bar items row shows the wrong icon for several items. Items that system agents draw, such as the input menu, show macOS's blank app icon. Wi-Fi, Bluetooth, Focus and Control Center's other items all show Control Center's icon. On a 1× display, Docker Desktop's icon is colored noise. Fixes #323.

Changes

All in Sources/StableBar/AppMenu.swift, through a new menuBarIcon(identifier:app:):

  • macOS's own items. menuBarSymbols now covers every com.apple.menuextra.* identifier in ControlCenter's and SystemUIServer's binaries, plus the input menu (com.apple.menuextra.textinput, or TextInputMenuAgent's bundle ID). Each gets a symbol like its menu bar glyph: Wi-Fi, Focus, Sound, Display, Now Playing, Screen Mirroring, AirDrop, Time Machine, VPN and others. SF Symbols has no Bluetooth rune, so Bluetooth's is drawn as a template image. A symbol missing on an older macOS falls back to the app's icon instead of crashing.
  • Processes without an icon. iconBundle(containing:) uses the process's own app when its Info.plist declares an icon (CFBundleIconFile, CFBundleIconName or CFBundleIcons), otherwise the nearest app around it that does, as for a helper or daemon inside an app. A system agent with neither shows menubar.rectangle instead of the blank placeholder.
  • Docker's noise. Docker Desktop's own icon.icns has noise in its 1× 16, 32 and 48 px images; its @2x and larger ones are fine. retinaArt(of:) always takes the icon's 18 pt @2x art, which a 1× display scales down, so a Retina display draws what it drew before.
  • The guide's Menu bar items section lists the new symbols and fallbacks, beside feat: open the Menu bar items row on hover #321's hover wording.

The live images of #83 aren't an option: while StableBar hides the menu bar, neither ScreenCaptureKit nor CGWindowListCreateImage returns an image of the items' windows.

Testing

  • New tests:
    • iconBundle finds the app around a helper and an unbundled daemon, and returns nothing for an agent without an icon.
    • menuBarIcon gives Wi-Fi its symbol, Bluetooth its rune and an agent without an icon menubar.rectangle, and draws an app icon from 36 px art.
    • Every name in menuBarSymbols is a system symbol.
    • An icon with a broken 1× image draws its Retina art at 1×. This one fails without retinaArt.
  • swift test on this branch rebased on main (with feat: open the Menu bar items row on hover #321): 294 XCTest and 463 Swift Testing tests pass.
  • The row drawn offscreen at 1× and 2× from this Mac's running apps, before (main) and after. From the left: Docker Desktop, Tailscale, Amphetamine, AeroSpace, Raycast, Shottr, JetBrains Toolbox, Bluetooth, Focus, Battery, Wi-Fi, the input menu, Spotlight, Control Center and Clock. The 1× images are doubled pixel for pixel.

1×, before

1×, after

2×, before

2×, after: the app icons match the 2× before.

  • Not checked:
    • The row on a running bar. That needs Accessibility access, which a dev build and this shell don't have. The owners above were matched to items from the window list and the saved status item positions.
    • The com.apple.menuextra.* identifiers for Wi-Fi, Bluetooth and Focus come from Control Center's binary. They follow the scheme of the Battery, Clock and Control Center identifiers that feat: open Control Center and the macOS menu bar's items from the bar #311 tried live.
  • git diff --check and commitlint pass.

Merging

A merge commit or rebase merge, which keeps the one commit. As a fix, it makes a patch release.

Claude Opus 5.5 via Claude Code

@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 26, 2026 10:43
@M4n0x
M4n0x enabled auto-merge October 26, 2026 10:48
Wi-Fi, Bluetooth, Focus and Control Center's other items now get a symbol like their menu bar
glyph, as Battery and Clock did. SF Symbols has no Bluetooth rune, so it is drawn. A system
agent without an icon, such as the input menu's, shows a menu bar symbol instead of macOS's
blank app icon, and a helper inside an app shows that app's icon.

App icons are drawn from their Retina art, so a 1× display no longer picks Docker Desktop's
broken 16, 32 and 48 px images.

Fixes #323
@M4n0x
M4n0x force-pushed the fix/menu-bar-items-icons branch from a605995 to a9d1d32 Compare October 26, 2026 11:02
@M4n0x
M4n0x merged commit 118a546 into main Oct 26, 2026
7 checks passed
@M4n0x
M4n0x deleted the fix/menu-bar-items-icons branch October 26, 2026 11:08
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Menu bar items row shows blank, shared and garbled icons

1 participant