Skip to content

native2: inspect captures after its Accessibility walk (#159) - #221

Merged
iamnbutler merged 2 commits into
mainfrom
fix-inspect-stale-capture
Oct 25, 2026
Merged

iamnbutler merged 2 commits into
mainfrom
fix-inspect-stale-capture

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

Fixes #159

desktop_inspect ran the AX walk and the window capture concurrently, so the screenshot could predate layout the walk itself caused (a SwiftUI list loading rows as its children are read grows and pushes content down), and a point read off the screenshot landed on whatever moved there. The capture now runs after the walk, so the screenshot shows the layout the next point click sees.

Cost: the inspection now takes the walk's time plus the capture's, instead of the longer of the two. On the native2 fixture window (dev app, 8 runs each) total_ms went from ~50 to ~65-90 ms (noisy with other workers on the machine); on large windows it adds the walk time.

Not checked live on the System Settings > Spotlight repro, since that's the user's System Settings; swift build/swift test pass and the dev app inspects normally.

Reading a SwiftUI list's children can make it load rows and grow, moving
what's below after a screenshot taken during the walk, so a point read off
that screenshot missed. The capture now follows the walk.

Why: native2/Sources/DesktopHost/Inspect.swift#fn read | the screenshot must be taken after the AX walk, not concurrently: the walk itself can change layout (#159)
@iamnbutler
iamnbutler merged commit 7e1f577 into main Oct 25, 2026
2 checks passed
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.

An inspect screenshot can be stale for point clicks when its AX walk grows the layout

1 participant