Skip to content

A private macOS call that Apple removes would crash StableBar or keep it from launching #489

Closed

Description

@M4n0x

What happens

StableBar calls a few private macOS functions: to hide and reveal the menu bar (MenuBarDelay.swift), read Spaces (Spaces.swift) and lock the screen (WidgetActions.swift). Two kinds of them would fail hard if a macOS release removed the symbol:

  • CGSMainConnectionID, CGSSetMenuBarInsetAndAlpha, CGSGetActiveSpace, CGSCopyManagedDisplaySpaces and CGSCopySpacesForWindows are declared with @_silgen_name, which binds them when the app loads. Without any one of them, StableBar wouldn't launch at all.
  • SLSSetMenuBarVisibilityOverrideOnDisplay is looked up with a force-unwrapped dlsym (MenuBarDelay.swift:8). Without it, the first menu bar reveal crashes.

Lock Screen already handles a missing call with a message (#412).

Steps to reproduce

Not reproducible today: every symbol exists on macOS 26 and 27. It happens on the day a macOS update drops one. macOS 27 has already changed how the menu bar works (#366, #372).

Expected

A missing call turns its feature off (the bar can't hide the menu bar, the Spaces source shows an error), and the rest of StableBar keeps working.

Environment

Every release with these calls; the menu bar override came with #311.

Diagnosis

Look each symbol up at runtime in one place, as lockScreen() already does, so a missing one is nil and its caller degrades. ArchitectureRulesTests can then allow private API in that one file only and ban @_silgen_name.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    P1
    on Nov 8, 2026
  2. stablebar-releases commented on Nov 10, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.12.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions