Skip to content

Fix Window Switcher Recent Use after app launch - #553

Draft
xcv58 wants to merge 4 commits into
mactools-app:mainfrom
xcv58:codex/fix-window-switcher-launch-recency
Draft

xcv58 wants to merge 4 commits into
mactools-app:mainfrom
xcv58:codex/fix-window-switcher-launch-recency

Conversation

@xcv58

@xcv58 xcv58 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and result

A newly launched app can take focus and still appear below older windows the first time Window Switcher opens in Recent Use. The switcher now puts the launched window first when it can confirm or reliably infer focus.

Related to the window tracking and recency work in #415.

Changes

  • Reconcile Accessibility focus and WindowServer visibility before opening the chooser. Launch discovery and foreground handoffs share a single retry.
  • Preserve confirmed focus history when the chooser is canceled. Keep ambiguous focus out of history and preserve exact window identity for activation and closing.
  • Cover late app registration, partial Accessibility results, helper windows, and overlapping refreshes with regression tests.

Verification

  • The isolated Swift 6 build of PluginKit and Window Switcher passed for the macOS 14 target. The focused XCTest suite passed 111 tests, with four desktop-only tests skipped.
  • Controlled replays covered launch ordering, the single retry, foreground handoff, and focus history after Escape.
  • make validate-changelog and git diff --check passed.

UI evidence

A live macOS harness on an earlier revision verified cold-launch ordering and Escape using disposable AppKit windows. Physical hotkey testing of this revision remains pending.

Checklist

  • Core behavior and relevant risks are verified, with limits recorded above.
  • Native interaction recording is attached.
  • The user-visible change has an English plugin changelog fragment.
  • The PR uses existing plugin and host contracts.
  • The diff was checked for third-party material, credentials, local configuration, and generated files.

This branch has not been deployed

No deployments
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