Skip to content

Clicking a stale window icon in a workspace widget shows an AeroSpace error and keeps the icon #520

Closed

Description

@M4n0x

What happens

With "workspace": { "windows": true }, an AeroSpace workspaces widget showed an icon for a Tailscale window (window 3587) that AeroSpace had already taken off every workspace. Clicking the icon put a ⚠ in the widget with AeroSpace's error:

Window 3587 doesn't belong to any monitor. And thus can't even define a focused workspace

The icon and the ⚠ stayed until focus or the workspace changed.

Steps to reproduce

  1. Use AeroSpace and a workspaces widget with "workspace": { "windows": true }.
  2. A window the widget shows leaves AeroSpace's workspaces without a focus change. Here it was Tailscale's window (Tailscale is a menu bar app): macOS still has the window, off screen, but aerospace list-windows --all no longer lists it.
  3. Click the window's icon in the widget.

The AeroSpace side reproduces on its own: aerospace focus --window-id 3587 prints the message above and exits with status 2.

Expected

Clicking a window that's gone updates the widget: the icon disappears, without a warning. A click that fails for another reason still shows its error.

Environment

  • StableBar 0.12.0-beta.20261109161138.786
  • macOS 27.2
  • AeroSpace 0.21.3-Beta (d56e163)
  • Two displays: built-in and an external Dell

Evidence

  • aerospace focus --window-id 3587: the message above, exit status 2.
  • aerospace list-windows --all doesn't list 3587; CGWindowListCopyWindowInfo still has it, owned by Tailscale and off screen.

The ⚠ in the widget, with the error as its tooltip:

Workspace widget tooltip: Window 3587 doesn't belong to any monitor

Diagnosis

  • Sources/StableBar/Workspaces.swift: focus(_:) runs aerospace focus --window-id ID through run(_:). When the command fails, run(_:) only sets error; it refreshes only for yabai, and only after a command that succeeded. The widget keeps the stale icon, and BarView shows the error on the ⚠ until the next successful refresh().
  • AeroSpace's subscribe has no event for a window leaving its workspaces (closed, minimized, hidden or treated as a popup). StableBar listens to focus-changed, focused-workspace-changed, focused-monitor-changed, window-detected and mode-changed, so its snapshot stays stale until one of those fires.
  • AeroSpace gives this message for --window-id when the window has neither a workspace nor a monitor: minimized windows and popups sit in containers outside every workspace (cmdResolveTargetOrReportError.swift, nodeMonitor in TreeNodeEx.swift). list-windows --all lists only windows inside workspaces.
  • Dragging a stale window (moveWindows) refreshes after the failure but keeps the error, so the ⚠ stays even though the icon is gone.
  • yabai and OmniWM go through the same run(_:), so clicking a stale window there fails the same way.

Proposal

When focusing or moving a window fails, refresh the workspaces. If the window is no longer listed, drop the error, since the icon is gone; otherwise keep it.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    bug
    on Nov 10, 2026
  2. added 3 commits that reference this issue on Nov 10, 2026
    14c9847
    05483b9
    ec45fcc
  3. 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

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions