Skip to content

fix: add SSMenuAgent (Screen Sharing) to immovable items#238

Merged
stonerl merged 1 commit intostonerl:mainfrom
coygeek:fix/ssmenuagent-immovable
Mar 1, 2026
Merged

fix: add SSMenuAgent (Screen Sharing) to immovable items#238
stonerl merged 1 commit intostonerl:mainfrom
coygeek:fix/ssmenuagent-immovable

Conversation

@coygeek
Copy link
Contributor

@coygeek coygeek commented Mar 1, 2026

Summary

macOS prevents the SSMenuAgent menu extra (binoculars / Screen Sharing icon) from being repositioned via Command+drag. The item visually follows the cursor during the drag but springs back to its original position on mouse-up. This causes Thaw to retry the move 8 times and then show an error dialog.

  • Add SSMenuAgent (com.apple.SSMenuAgent:Item-0) to immovableItems so the layout editor disables dragging for this item entirely
  • Add .ssMenuAgent namespace constant and tag constant following the existing pattern
  • Add .ssMenuAgent to isSystemItem for consistent system item identity

Investigation Details

Environment

  • macOS 26.3 (Tahoe), MacBook Pro, Thaw signed release
  • SSMenuAgent tag: com.apple.SSMenuAgent:Item-0 (sourcePID correctly resolved via XPC)

Manual Command+drag test

Holding Command and dragging the binoculars icon in the menu bar: the icon follows the cursor during the drag, but when released, it springs back to its original position. This matches the behavior of Clock and Control Center (both already in immovableItems).

Layout editor drag

Dragging SSMenuAgent from the Visible bar to the Hidden bar in Thaw Settings → Menu Bar Layout produces this error dialog:

"SSMenuAgent" took too long to respond
Please try again. If the error persists, please file a bug report.

This is EventError.itemResponseTimeout — the move() function posts Command+drag events, waitForMoveEventResponse() polls for position change, the item never moves, and after 8 retry attempts the error propagates.

Diagnostic logs (from log stream --predicate 'subsystem == "com.stonerl.Thaw"')

cacheItemsRegardless: item tag=com.apple.SSMenuAgent:Item-0 (windowID: 15030) title=Item-0 windowID=15030 sourcePID=44321 ownerPID=450

The XPC service correctly resolves the true owner PID (44321 = SSMenuAgent), while ownerPID reports 450 (Control Center) due to the macOS 26 CGWindowList regression (FB18327911).

Code path

  1. LayoutBarPaddingView.move()appState.itemManager.move(item:to:)
  2. move() passes item.isMovable check (SSMenuAgent not in immovableItems)
  3. postMoveEvents() creates Command+mouseDown/mouseUp CGEvents targeted at SSMenuAgent's sourcePID
  4. waitForMoveEventResponse() polls item origin for ~100ms — item never moves
  5. Throws EventError.itemResponseTimeout → caught by retry loop
  6. After 8 attempts, error propagates → NSAlert shown

Context

This issue also exists in Ice (the upstream project Thaw was forked from). I originally discovered and reported it there as jordanbaird/Ice#885, where it manifests as a "Missing bounds rectangle" error instead. Now that I'm using Thaw, I'm submitting the fix here since Thaw is the actively maintained fork. The root cause is the same: macOS prevents SSMenuAgent from being repositioned, but neither Ice nor Thaw had it in their immovable items list.

Test plan

  • Verify SSMenuAgent (binoculars) icon is grayed out / not draggable in the Menu Bar Layout editor
  • Verify no error dialog appears when the layout is loaded with SSMenuAgent present
  • Verify other items (Stats, 1Password, etc.) remain fully draggable
  • Verify Clock and Control Center remain immovable (no regression)

Related: jordanbaird/Ice#885

🤖 Generated with Claude Code

macOS prevents the SSMenuAgent menu extra (binoculars icon) from being
repositioned via Command+drag. The item visually follows the cursor
during the drag but springs back to its original position on mouse-up.

Without this fix, Thaw attempts to move SSMenuAgent via programmatic
Command+drag events, retries 8 times, and eventually shows an
"SSMenuAgent took too long to respond" error dialog
(EventError.itemResponseTimeout).

Changes:
- Add .ssMenuAgent namespace constant (com.apple.SSMenuAgent)
- Add .ssMenuAgent tag constant (namespace: .ssMenuAgent, title: "Item-0")
- Add ssMenuAgent to immovableItems so the layout editor disables
  dragging for this item
- Add .ssMenuAgent to isSystemItem so windowID is ignored in
  equality/hashing (consistent with other system items)

Verified by:
- Manual Command+drag test: item springs back on mouse-up
- Thaw diagnostic logs: tag=com.apple.SSMenuAgent:Item-0,
  sourcePID correctly resolved via XPC, ownerPID=450 (Control Center)
- Layout editor drag: 8 retry attempts all fail with itemResponseTimeout
- Build succeeds with xcodebuild (ad-hoc signing)

Related: jordanbaird/Ice#885

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Owner

@stonerl stonerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much for your contribution.

@stonerl stonerl merged commit effcd9e into stonerl:main Mar 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants