Skip to content

Commit ccb4750

Browse files
authored
fix: attribute sheet controls to the window the sheet is attached to (#8)
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.
1 parent d18f1a3 commit ccb4750

4 files changed

Lines changed: 368 additions & 0 deletions

File tree

‎dist/build.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const patches = [
3636
"peekaboo-menu.patch",
3737
"peekaboo-clipboard-files-write.patch",
3838
"peekaboo-stale-click.patch",
39+
"peekaboo-sheet-window.patch",
3940
].map((name) => join(native, "patches", name));
4041
function spawn(command, env) {
4142
return spawnSync(command[0], command.slice(1), { encoding: "utf8", env: env ?? process.env });

‎native/patches/README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,18 @@ Later route checks are unchanged: a route can follow an earlier Accessibility at
172172
dispatched, so a window change detected there still reports uncertain input. Long press keeps its
173173
existing exact-window exemption, and process-generation checks are unchanged.
174174

175+
`peekaboo-sheet-window.patch` attributes sheet controls to the window the sheet is attached to,
176+
for [Save sheets refusing every mutation](https://github.com/githubnext/ace/issues/378). A sheet
177+
is its own WindowServer window but is absent from the application's AXWindows, so an exact-window
178+
observation reaches it only through the parent window's tree. A sheet control's AXWindow link names
179+
the sheet, and an Open or Save panel's controls resolve to the Open and Save Panel Service's own
180+
window; neither matches the observed window, and the detached identity read used before value and
181+
focus writes accepted only that link. The shared owning-window resolver now accepts the AXWindow
182+
link only when it is a same-process `AXWindow`; otherwise it walks a bounded `AXParent` chain to the
183+
nearest same-process `AXWindow`. An element with no such ancestor keeps its direct window identity.
184+
The detached reader resolves through the same helper under its deadline, so element identity,
185+
exact-window click receipts, and post-write observation agree. Sibling windows are still refused.
186+
175187
`desktop-tools-build` resolves only `Package.resolved` versions, checks the pin and checkout revision,
176188
and assembles the ordered patch stack in a private Git index. A build compares the checkout
177189
with each complete ordered prefix, since later patches can change earlier patch contexts.

0 commit comments

Comments
 (0)