Repository navigation
fix: attribute sheet controls to the window the sheet is attached to - #8
Merged
Merged
Conversation
Save and Open sheets are separate WindowServer windows outside the app's AXWindows; their controls link to the sheet or to the Open and Save Panel Service's window, so the detached identity read before focus and value writes could not resolve the observed window and refused every mutation (githubnext/ace#378). Resolve the nearest same-process AXWindow instead, in one helper shared by element identity and the detached reader.
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
peekaboo-sheet-window.patchfor githubnext/ace#378: on TextEdit's Save sheet every desktop mutation refused with "The native Accessibility target could not be revalidated before mutation."Cause. Before a focus or value write,
ActionInputDriver.observationTargetreads the element's identity throughDetachedExactWindowFocusReader, which requires a CGWindowID from the element'sAXWindowlink and nothing else. A sheet is its own WindowServer window, absent from the app's AXWindows, so an exact-window observation reaches it only through the parent window's tree. Its controls link to the sheet, and an Open/Save panel's controls resolve to the Open and Save Panel Service's own window (trycua/cua#4507 observed button → service window 173, AXSheet 172, parent AXWindow 167). The identity read therefore had no usable window and every mutation refused before dispatch.Change.
AXWindowIDResolver.owningWindowIDaccepts the AXWindow link only when it is a same-processAXWindow, otherwise walks a boundedAXParentchain to the nearest same-processAXWindow; an element with no such ancestor keeps its direct identity. The detached reader resolves through the same helper under its deadline, so element identity, exact-window click receipts and post-write observation agree. Sibling windows are still refused. The upstream unit tests for both files are updated for the new contract.Verification.
npm run check; full native build (node dist/build.js);swift test --filter 'AXWindowIDResolverTests|DetachedExactWindowFocusMetadataTests'(15 passing; the PeekabooAutomationKit test target needed a local, uncommitteddefaultcase inClipboardPasteTransactionGateTeststo compile because of an earlier patch). Not verified against a live Save sheet: the Mac was driving a study and no GUI app could be opened. The Ace study lead will rerun scenario 20 step 3.