Conversation
This branch has not been deployed
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.
Problem
The macOS adapter uses host-gated consumer focus queries for
isAccessibilityFocusedand its view's focused-element query. When a host becomes inactive, those queries lose the focused element even though AppKit controls continue to expose their window-local first responder. This prevents assistive clients from reliably targeting controls in background windows.Change
Read focus within the tree for these two macOS queries, resolve an active descendant when present, and retain the existing focusability filter. Global focus-change notifications continue to use host-focused consumer state, so background updates do not move the screen reader's global focus.
Add a native main-thread regression covering inactive/active hosts, independent windows, focus changes, active descendants and their removal/restoration, and root exclusion. The test creates hidden windows and never activates the application. Document the query/notification distinction. This ports the prepared change to the current
adapters/macoslayout andTreeInfoAPI; generated changelogs are untouched.Verification
cargo fmt --all -- --checkcargo test -p accesskit_macos -p accesskit_consumer --locked: 206 consumer tests plus the native macOS focus regression passed.cargo clippy -p accesskit_macos -p accesskit_consumer --all-targets --locked -- -D warningsThe fix is limited to macOS focus queries. It does not alter consumer focus semantics or host-gated notification delivery.
AI-assisted: this change was developed with AI coding assistance (OpenAI Codex) and reviewed and tested by the author.