Repository navigation
native2: inspect captures after its Accessibility walk (#159) - #221
Merged
Merged
Conversation
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)
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.
Fixes #159
desktop_inspectran 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 testpass and the dev app inspects normally.