Skip to content

Fix native tab window replacement - #2206

Open
trentkm wants to merge 2 commits into
nikitabobko:mainfrom
trentkm:fix/native-tab-window-replacement
Open

Fix native tab window replacement#2206
trentkm wants to merge 2 commits into
nikitabobko:mainfrom
trentkm:fix/native-tab-window-replacement

Conversation

@trentkm

@trentkm trentkm commented Jul 29, 2026

Copy link
Copy Markdown

Fixes #68

Builds on the AXWindows reconciliation explored in #2092.

PR checklist

  • Explain changes in commit messages rather than the PR description.
  • The commit explains what, why, how, and motivation.
  • Relevant issue and prior PR are linked in the commit.
  • The commits are atomic changes.
  • ./test.sh exits with zero exit code.
  • No merge commits.

trentkm added 2 commits July 29, 2026 11:12
Ghostty and Fork expose each macOS native tab as a distinct AXWindow. Hidden tabs retain valid window IDs, so the containing-window liveness check keeps them in AeroSpace's model and the newly selected tab is placed through MRU as if it were a new window. This makes tab switching move or resize the visible window.

For these known bundle IDs, reconcile tracked AX windows with the app's AXWindows list after registering the focused window. Skip that reconciliation while the mouse button is down and while the lock screen is frontmost, preserving the existing safeguards around tab detaching and lock-screen notifications.

Replace a stale tab synchronously in the layout tree. Prefer the app's previous native-focused window ID, fall back only when one stale candidate exists, and preserve its exact parent, index, adaptive weight, floating size, fullscreen state, and cached layout geometry. Replacement tabs bypass on-window-detected because they are the same logical window rather than newly opened app windows.

Add regression coverage for nested slot and weight preservation, previous-focus selection, ambiguous stale candidates, and the affected bundle-ID allowlist.

Fixes nikitabobko#68

Builds on the AXWindows reconciliation explored in nikitabobko#2092
Orientation uses the h/v enum cases. Use .h when asserting that the replacement retained its horizontal-container adaptive weight so the regression test compiles on the CI matrix.
@nikitabobko nikitabobko added the not-actionable By default, all PRs have this label. If the PR makes sense, the label will be removed. label Aug 10, 2026
vitorebatista added a commit to vitorebatista/AeroSpace-edge that referenced this pull request Aug 27, 2026
…te sync state

Sync state moves to upstream main @ c548c7f / 59 open PRs, reviewed 2026-08-27.
Adds the newly ported upstream PRs (2244, 2232, 2211, 2228, 2225) to the
already-backported list, and records this cycle's skips: focus-follows-mouse PRs
(nikitabobko#2238/nikitabobko#2245, feature absent in the fork), nikitabobko#2220 (duplicate of the already-ported
nikitabobko#2024), nikitabobko#2213 (deletes lastNativeFocusedWindowId, which fork PR #59 depends on),
nikitabobko#2206 (competing implementation of nikitabobko#2225), and six deferred feature PRs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WBcwRe3CktWZGGcHJHP4ds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-actionable By default, all PRs have this label. If the PR makes sense, the label will be removed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native macOS Big Sur tabs are considered windows

2 participants