fix: resolve menu bar item source apps on macOS Tahoe (26.x)#789
fix: resolve menu bar item source apps on macOS Tahoe (26.x)#789roelvangils wants to merge 2 commits intoFelixKratz:masterfrom
Conversation
On macOS 26 (Tahoe), Apple changed the ownership of third-party menu bar items. These items are now owned by "Control Centre" instead of their source applications. This breaks the alias feature as SketchyBar can no longer identify which app owns which menu bar item. This fix uses the Accessibility API to resolve the real source application for each menu bar item: - Adds source_pid.h/m: New module that uses AXUIElementRef and the kAXExtrasMenuBarAttribute to find the real source app by matching window bounds to accessibility element frames - Updates alias.c: Integrates the source PID lookup in both print_all_menu_items() and alias_find_window() functions - On macOS < 26, the existing behavior is preserved The approach is similar to how Ice menu bar manager solved this issue in their macos-26 branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reformatted --query default_menu_items output to show a clean table with app names and ready-to-use alias commands - Added 5-second throttle to source_pid_cache_refresh() to prevent performance issues when multiple aliases update simultaneously - Moved throttle check inside mutex lock to prevent race conditions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Tested on my macOS 26.0 Beta (25A5346a):
If Accessibility is off, the query shows a bunch of |
|
@FelixKratz, just checking in on this. Are there any concerns or blockers holding this PR up? The underlying issue impacts the Sketchybar experience quite a bit, so I'd love to get this resolved. Let me know if there's anything we can do to help address any hesitations you might have! |
|
I had a go at fixing this issue myself here: 262fa35. For context, the issue I had with this approach here is that it involves a lot of additional book-keeping and additional permission requirements (accessibility). The owner of the menu bar items moving to Control Center was actually never the core problem of the design. The design was never meant to handle duplicate owner-name combinations. Those started to appear frequently with the owner moving to Control Center. The solution is to simply add an additional index to Please test with latest master if problems are resolved. |
Summary
AXUIElementRefwithkAXExtrasMenuBarAttribute) to resolve the real source app by matching window bounds to accessibility element framesProblem
On macOS 26, Apple changed how third-party menu bar items work. Instead of items being owned by their source applications (e.g.,
Little Snitch Agent,Item-0), they are now all owned byControl Centre(e.g.,Control Centre,Item-0). This breaks SketchyBar's alias feature since it relies on the owner name to match items.Solution
This PR adds a new
source_pidmodule that:kAXExtrasMenuBarAttribute(extras menu bar / status items)The approach is similar to how Ice menu bar manager solved this in their
macos-26branch.Test plan
--query default_menu_itemsreturns correct app names instead of "Control Centre"Little Snitch Agent,Item-0)Files changed
src/source_pid.h- Header for new source PID modulesrc/source_pid.m- Implementation using Accessibility APIsrc/alias.c- Integrated source PID lookup inprint_all_menu_items()andalias_find_window()makefile- Addedsource_pid.omto build🤖 Generated with Claude Code