Skip to content

Serialize and confirm Space transitions - #87

Draft
jemmyw wants to merge 2 commits into
jurplel:mainfrom
jemmyw:fix/serialize-space-transitions
Draft

Serialize and confirm Space transitions#87
jemmyw wants to merge 2 commits into
jurplel:mainfrom
jemmyw:fix/serialize-space-transitions

Conversation

@jemmyw

@jemmyw jemmyw commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • serialize synthetic Space gestures through a small state machine
  • wait for NSWorkspace.activeSpaceDidChangeNotification before refreshing Space state, showing the OSD, or starting the next queued request
  • route intercepted trackpad swipes through the same coordinator
  • add bounded timeout recovery and structured unified logging
  • add focused tests for queueing, confirmation, stale notifications, timeout recovery, and FIFO ordering

Motivation

My laptop crashed when switching spaces.

The app previously queried changing private CGS state and could order its layer-backed cross-Space OSD immediately after injecting a Dock gesture. Rapid requests could also inject multiple gestures without waiting for macOS to confirm the preceding transition. This creates avoidable overlap between the app, Dock, WindowManager, and CoreAnimation during a Space transition.

This keeps the fast synthetic gesture path while preventing app-controlled overlap. The existing upstream began/changed/ended gesture sequence is unchanged.

Behavior

  • Adjacent requests are FIFO.
  • Duplicate or stale notifications do not confirm a newer transition.
  • Existing OSD content is removed before injection.
  • Intermediate OSDs are suppressed while queued transitions remain.
  • Timeout or injection failure drops queued requests and enters a bounded recovery period instead of blindly injecting again.
  • Numbered app shortcuts are decomposed into confirmed adjacent transitions.

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.

1 participant