Repository navigation
Unify App process scope and foreground-window semantics - #436
Merged
Merged
Conversation
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.
Motivation
Appa consistent process-scoped abstraction across platforms so callers see one logical application per process while still exposing every native registration where it matters.Description
Appview by deduplicatinglist_apps()results (process-scoped enumeration) and addingfn app_roots(&self, app: &ElementData) -> Result<Vec<ElementData>>toProviderso backends can expose every native root for a process.App::windows_with/App::children/App::treetraverse all native roots for a process, merge windows by stable identity, and avoid duplicate listings; adddedup_processesand updatetag_focusedto use the provider'sfocused_app()identity rather than a pid-only heuristic.Locatorwith process-scoped resolution (new_for_app) and support for searching across multiple native roots with stable-identity deduplication to preserve doc-order and:nthsemantics.find_apps_by_pidandapp_rootsimplementations and updatesubscribe_for_pidto install D-Bus match rules for every AT-SPI registration owned by the process and to preserve the originating sender bus when materializing events;EventContextnow accepts multiplesender_busesand dispatches only signals from those senders.activemapping fromAXMainto the frontmost application's focused (key) window by readingAXFocusedApplication/AXFocusedWindowto correctly mark windowactivewhen key differs from main.Appand how callers should select windows/registrations now.Testing
cargo test -p xa11y-core --lib, which passed all unit tests inxa11y-core(283 tests, all OK).RUSTFLAGS=-Dwarnings cargo check -p xa11y-core -p xa11y-linux -p xa11y-macos, which succeeded (no warnings-as-errors).cargo xtask check-macos-ffi, which passed the macOS FFI exception-safety check.cargo xtask fmt --check, which passed formatting checks.cargo xtask check(workspace pre-PR checks); the tooling completed its linting, bindings-parity, format and many checks successfully, but full workspace test/linking failed where the environment lacks system dependencies: the build/link stage forxa11y-linux/fuzz targets failed due to missinglibxkbcommon(linker error), andcargo xtask test-integcould not run because the runner lacks Xvfb/AT-SPI daemons and other system fixtures; these are environmental, not functional, failures in CI-like harnesses.cargo xtask lint-docscould not complete becausevaleis not installed in the environment; prose linting should be verified in CI or locally withvaleavailable.If you want, I can open follow-ups to (1) add CI notes about the new
Provider::app_rootscontract for downstream providers, and (2) prepare a changelog/migration note for bindings/docs that call out the behavioral change from registration-scoped to process-scopedAppobjects.Codex Task