Repository navigation
fix(macos): find the window of a control that omits AXWindow (carry #453) - #6
Merged
Merged
Conversation
System Settings popup buttons answer kAXErrorNoValue for AXWindow even though an AXWindow encloses them. ancestor_viewport then had no viewport, the live offscreen state stayed unknown, and because a popup button never reports AXExpanded the actionability gate waited out its whole 5 s budget. select, click and expand on these popups failed with TIMEOUT and a "target may be busy" suggestion. When AXWindow has no value, the viewport now starts from the first AXWindow in the parent chain. A chain that reaches the application without a window, as open menu content does, still has no viewport.
An open popup menu hangs off its popup button, so its parent chain passes through the enclosing AXWindow. The window-ancestor fallback would have given menu items that window's viewport, and an item drawn outside the window would read as offscreen. The search now stops at the first menu role, so menu content keeps no viewport, as it had before the fallback. Measured on a System Settings popup: select takes about 2.9 s with and without this guard, and changes the value in both builds.
The carried window-ancestor fallback put element_bounds.rs at 406 lines, over the 400-line cap; its inline tests now live in element_bounds_tests.rs as the layout rule asks.
…e content or failing reads Review of the carried fallback found three gaps. A menu or popover used as the start element still walked up to its host window and read as offscreen; a popover's content was not stopped at all; and an unreadable parent chain on the fallback now failed state reads that used to report an unknown viewport. The search now starts at the element itself, stops at AXPopover as well as the menu roles, and any fallback read failure leaves the viewport unknown as before. The primary AXWindow path and its clipping walk are unchanged.
gshost1
added a commit
that referenced
this pull request
Nov 8, 2026
Main carries #6 as a squash, so its element_bounds conflicts with this branch's copy. Main's clip_by_ancestors is the version this fix was written against; both hunks keep this branch's side.
This was referenced Nov 8, 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.
What
This carries upstream PR
#453by joeVenner, "find the window of a control that omits AXWindow", as its two commits, with review fixes on top.Some pop-up buttons answer
kAXErrorNoValueforAXWindow, such as the Where and File Format pop-ups in a save sheet and System Settings pop-ups. Their live offscreen state then stayed unknown. Their expandable role never publishesAXExpanded, so their states also count as incomplete. With both, the core visibility gate returnsunknown, and aclick,selectorexpandwaits out the 5 s actionability budget and fails withTIMEOUT.ancestor_viewportnow takes the viewport from the firstAXWindowin the parent chain whenAXWindowhas no value.Review fixes added here:
AXMenuorAXPopoverused as the start element no longer takes its host window as its viewport. Before this fix it would have read as offscreen.AXPopoverjoins the menu roles that stop the search, because popover content draws outside its window.AXWindowpath and its clipping walk are unchanged.element_boundstests move toelement_bounds_tests.rsfor the 400-line cap. A stale doc comment is corrected.Why
In the speed bench's TextEdit Save task, pop-up actions in the Save sheet waited out the full 5 s and then failed with
TIMEOUT, about 170 s over 10 runs, and the model retried each time.How tested
-D warnings, the source rules and the architecture check.an_own_surface_element_has_no_window_ancestor_even_as_the_startanda_control_inside_a_popover_has_no_window_ancestor, both invert-verified: removing the start check or the popover stop makes each fail.bench/probe_savepanel.sh): TextEdit, new document,cmd+s, then a click on the first pop-up in the Save sheet. Base is fork main c4d3961.TIMEOUT,visible: live offscreen state unavailabledelivered_verified,AXPressThe review fixes came after this A/B. They change only menu, popover and read-failure cases, not a pop-up button inside a sheet. A re-run on the final binary is queued in the next lock round.
bench/probe_savepanel.sh, 2026-11-07): base 5,080 msTIMEOUT, head 179 msok. The sheet snapshot took 396–441 ms with 82 refs,complete: true.bash scripts/perf-baseline-compare.sh --base origin/main(bench/perf_compare_branches.sh, 2026-11-07): neutral. Every case is within 5%, with the same ok rate and output shape on both binaries.snapshot -isnapshot skeletonsnapshot d30getis visibleclickset-valuetypeRisks
AXWindowresolves directly but which draws outside the window is unchanged; that path is not part of this PR.AXWindowhas no value, which used to fail after 5 s instead.What's left
app_menutreats an invalidated node as fatal and reacquires inobserve()instead.macOS E2E, against the main baseline
AGENT_DESKTOP_E2E_EXCLUSIVE=1 bash tests/e2e/run.shon this branch (headdc598931, which contains forkmain4e9420d0) and onmain4e9420d0itself:main4e9420d0dc598931No new failure, so no regression. The gate fails on every checkout because Screen Recording is off on this Mac. macOS then gives CoreGraphics windows no name,
list-windowsfalls back to the app nameAgentDeskFixture, and the guard requires the window titleAgentDesk Fixture, which AX reports correctly. A fix for that title fallback is tracked separately.