You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(x11): Linux AT-SPI accessibility backend for the Skia.X11 head - #24381
Discussed in #24256: maintainers confirmed a Linux AT-SPI backend is in scope and suggested mirroring the macOS seam.
PR Type:
✨ Feature
What changed? 🚀
Adds a Linux / X11 AT-SPI2 accessibility backend to Uno.UI.Runtime.X11. Previously the X11 head rendered to the screen but published no accessibility tree, so Uno apps were invisible to Orca and to AT-SPI-based automation.
New src/Uno.UI.Runtime.X11/Accessibility/:
AtspiServer: discovers the accessibility bus (org.a11y.Bus.GetAddress), registers through org.a11y.atspi.Socket.Embed, and serves each node over D-Bus with Tmds.DBus.Protocol (already referenced by the head). Interfaces: Accessible, Component, Application (root), Action, Value, Text, EditableText, Selection, plus Properties and Introspectable. Signals follow Event.xml: state-changed, property-change, children-changed, selection-changed, text-changed, text-caret-moved, text-selection-changed, window:activate/deactivate and announcement.
X11Accessibility : SkiaAccessibilityBase: builds an AtspiNode tree from the automation peers (Raw elements and popup wrappers are flattened), enriched from AriaMapper and the automation providers. It turns the base class's update, focus and child hooks into signals, and implements the write path (IWriteTarget), which drives the real control through its provider on the UI thread.
AtspiEnablement: follows the desktop's org.a11y.Status (IsEnabled || ScreenReaderEnabled) and starts or stops the bridge live, so no tree is built or published while accessibility is off. Only the status watcher stays connected. Once a bridge has run, the router's tree hooks stay installed, as on the other heads. There is no app-level opt-out or force-on switch.
AtspiTextSegmentation: AT-SPI offsets count characters (code points), not UTF-16 units. This maps them and finds character, word and line boundaries for the Text interface; sentences are approximated by lines.
AtspiRoleMap: AutomationControlType to AT-SPI role ids, matching atspi-constants.h. Unmapped types fall back to panel.
Host wiring mirrors the macOS head: X11XamlRootHost implements IAccessibilityOwner and becomes the router's active owner on FocusIn, AccessibilityRouter is initialized in X11ApplicationHost, and its tree notifications are enabled once the AT-SPI server is up.
What a screen reader gets:
Tree and roles: a frame per window under the application, headings, landmarks, toggle buttons, three-state check boxes, modal dialogs and password fields with their proper roles. A PasswordBox publishes no text and cannot be edited through EditableText.
Geometry: screen-absolute extents from the X11 client origin, scroll offsets and transforms, HiDPI-aware, with showing derived from the clipped bounds.
Live updates and focus: state, property, structure and text signals, the focused node (including focus set before the screen reader attached), and Component.GrabFocus.
Writes: Action.DoAction, Value.CurrentValue, EditableText (set, insert, delete), caret and text selection, and Selection.SelectChild, all through the providers. Text edits and caret or selection moves are applied to the control's current text, so quick successive requests do not overwrite each other. Writes to disabled controls, read-only ranges and non-finite values are ignored; the reply only confirms the request was queued (see Notes).
Announcements: AnnounceOnPlatform and LiveSetting changes, polite or assertive.
Also included: the Accessibility_Showcase sample (Automation category), with one section per screen-reader capability; unit tests for the text offsets and role ids; and docs updates.
Given_AtspiTextSegmentation and Given_AtspiRoleMap in Uno.UI.UnitTests. AtspiTextSegmentation.cs and AtspiRoleMap.cs are compile-linked the same way as X11PointerCoordinateMath.
@ramezgerges reviewed 5086ca8185 against Orca 46 and libatspi on Ubuntu 24.04, and pushed the resulting fixes (0af09bef81), the Accessibility_Showcase sample (ae1dcd0d13) and the NO_AT_BRIDGE removal (54d125dbd2).
The later commits were verified headless only (Xvfb + at-spi2-core 2.52 + a libatspi client), with a before/after run for each fix. The exception is the disabled-control guard, which was checked by code review only because the sample has no disabled control.
Runtime tests cannot reach the X11 head's internals.
📚 Docs have been added/updated: features/accessibility/index.md (Linux row and limitations note, how it works), automation-peers.md (Linux in the Skia architecture) and testing-with-screen-readers.md (activation, inspecting the AT-SPI tree, a common issue).
🖼️ Validated PR Screenshots Compare Test Run results: no visual change. Accessibility_Showcase is a manual test, which snapshot runs skip, and Screenshot Comparison passed on 67e2c46fa5.
❗ Contains NO breaking changes: additive, and no other head is touched.
Each window has its own application root, so a multi-window app appears as several applications.
Cache.GetItems is not implemented. Clients log a dbind-WARNING and fall back to per-object queries.
The role map still maps Menu/MenuItem, Tree/TreeItem, Group, ToolTip, Spinner and others to panel.
Action is exposed for buttons, toggles, combo boxes and selectable items only, not for links or expanders.
Selection supports SelectChild only. CutText and PasteText are not implemented, and CopyText does nothing.
Text character and range extents report the whole text box (no per-glyph layout), and GetOffsetAtPoint returns -1.
Component.GetExtents/GetPosition always return screen coordinates, whatever coord_type is requested. Hit-testing does honour coord_type.
Any structural change rebuilds the whole tree (about 2 ms for about 830 nodes in Release, measured by @ramezgerges).
Data-only ComboBox items (no ComboBoxItem container) get paths keyed by index, so a held reference follows the index rather than the item.
Write methods reply once the request is queued on the UI thread. The signal that follows is the confirmation, as documented on the IWriteTarget implementation in X11Accessibility.
Tmds.DBus.Protocol stays at the head's 0.92.0. Two things worth knowing: MessageWriter is a ref struct, so a by-value helper silently drops the message body, and 0.92 tears the connection down on an unhandled incoming call. Both are handled.
Adds an Accessibility/ subsystem to Uno.UI.Runtime.Skia.X11 that publishes
the automation peer tree on the AT-SPI accessibility bus:
- AtspiServer: a11y-bus discovery (org.a11y.Bus.GetAddress), Socket.Embed
registration, and a per-node D-Bus handler serving Accessible, Component,
Application (root), Properties and Introspectable over Tmds.DBus.Protocol.
- X11Accessibility: SkiaAccessibilityBase implementation building AtspiNode
trees from automation peers (AccessibilityView.Raw elements skipped),
with coalesced full-tree rebuilds on structure changes.
- AtspiRoleMap: AutomationControlType to AtspiRole id mapping (ids match
at-spi2-core atspi-constants.h; unmapped types fall back to panel).
- Host wiring mirroring the macOS head: X11XamlRootHost implements
IAccessibilityOwner, AccessibilityRouter is initialized in
X11ApplicationHost and activated on FocusIn.
Read path + registration only; live events, the write path and per-node
tree diffing land in follow-up PRs.
Co-Authored-By: Claude Fable 5 <[email protected]>
- Subscribe scroll sources during tree build and on child add, per the
SkiaAccessibilityBase contract, so descendant bounds refresh on scroll.
- Stop the AT-SPI server instead of leaking the D-Bus connection when the
window closes during async startup.
- Use the registry null reference for missing children, matching the
at-spi2-core convention.
- Activate the accessibility router before the focus callback on FocusIn.
- Rename the mislabeled WindowLayer constant (value 3 is ATSPI_LAYER_WIDGET),
hoist the application role id into AtspiRoleMap, type the bare catch.
Co-Authored-By: Claude Fable 5 <[email protected]>
…0.92
Runtime-proven against a headless AT-SPI stack (Xvfb + at-spi2-core): the
bridge now registers on the accessibility bus and serves the live tree to an
external client.
- WriteReference took the MessageWriter (a ref struct) by value, so the (so)
struct writes mutated a copy and the Embed body went out empty; the daemon
saw a body/signature mismatch and closed the connection. Pass the writer by
ref (and inline the struct write where the writer is a using-variable).
- Embed via the non-generic CallMethodAsync with the root parent set directly,
matching the reference implementation; the reply is not needed.
- Register the node handler at /org/a11y/atspi so post-Embed registry callbacks
on sibling paths get a well-formed reply; 0.92 tears the connection down on
an unhandled incoming call.
- Wrap incoming dispatch in try/catch so a malformed client request can never
propagate and drop the whole connection.
Co-Authored-By: Claude Fable 5 <[email protected]>
…vents, write path
Brings the X11 accessibility backend to behavioral parity with the macOS and
WASM Skia heads. Runtime-proven against a headless at-spi2 stack: an external
AT-SPI client reads enriched state, writes through the accessibility bus, and
receives live signals.
- Enriched AtspiNode from AriaMapper.GetAriaAttributes + automation providers
(toggle/range/value/text/expand/selection), plus heading/landmark/required/
position-in-set; coordinates via absolute visual offset; labels via the shared
ResolveLabel.
- Serve the full interface set per capability: Action, Value, Text, EditableText,
Selection (in addition to Accessible/Component/Application), with a matching
richer GetState and GetInterfaces, and Action.NActions exposed as a property.
- Write path: AtspiServer.IWriteTarget implemented by X11Accessibility, driving
the real control through its provider on the UI thread (invoke/toggle/set-value/
set-text/select-child).
- Live events: the base class Update*/SetNativeFocus/child callbacks now emit
AT-SPI StateChanged / PropertyChange / SelectionChanged / children-changed
signals; focus is tracked for the focused state.
Proven: EditableText write read back through Text; Value set read back; Action
do_action('click'); state-changed/property-change signals observed on the bus.
Co-Authored-By: Claude Fable 5 <[email protected]>
Both reviewers (kimi APPROVE, DS REQUEST CHANGES) plus runtime re-proof:
- BLOCKER: write-path lookups ran on the D-Bus reader thread against a
Dictionary mutated on the UI thread. Publish an immutable element snapshot
(volatile swap, mirroring the node-tree snapshot) and read that instead.
- Reflect Offscreen in GetState (showing/visible only when on-screen).
- Serve the Accessible Description property from the node.
- Add ATSPI_STATE_READ_ONLY / REQUIRED in the second state word so the state
set matches the signals emitted for them.
- List/container items (ListViewItem/ListBoxItem) surface as selectable via the
AriaMapper Selected fallback, not only the SelectionItem pattern.
- ComboBox advertises its selected text through the Text interface.
- Restore focus to the fresh node after a tree rebuild.
- Drop combo data-item nodes (Handle 0) from the handle maps; remove the unused
EmitChildrenChanged child parameter and dead ReplyEmptyDictionary; make the
new AtspiNode members properties.
Co-Authored-By: Claude Fable 5 <[email protected]>
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. 2 out of 3 committers have signed the CLA.
✅ ramezgerges ✅ egarim ❌ claude You have signed the CLA already but the status is still pending? Let us recheck it.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The AT-SPI server currently advertises interface support (notably Value) that it does not dispatch/handle, and the ComboBox item enumeration strategy risks severe performance issues on large item sources.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds a Linux/X11 AT-SPI2 accessibility backend for the Skia.X11 head so Uno apps can publish an accessibility tree over D-Bus (improving parity with other Skia heads and enabling Orca / AT-SPI automation tooling).
Changes:
Wires X11 window hosts into the shared AccessibilityRouter (initialization + activation tracking).
Introduces an X11-specific SkiaAccessibilityBase implementation that builds an AT-SPI node tree and supports a write path back into UI Automation providers.
Adds an AT-SPI D-Bus server implementation (AtspiServer) plus supporting node/role mapping types.
Add the window's screen origin (AppWindow.Position, from the X11 root-relative
XTranslateCoordinates the window wrapper already computes) to each node's
client-space offset, so GetExtents/GetPosition return true screen coordinates.
Runtime-proven: with the window moved to (300,200), a control at client (284,4)
reports screen extents (584,204).
Co-Authored-By: Claude Fable 5 <[email protected]>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
There are confirmed lifecycle/threading issues in the X11 accessibility startup/disposal path that can leak the D-Bus connection and retain UIElement references after window close.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
_server is assigned on the async continuation thread (not the UI thread). There is a race where DisposeCore() can run after the IsDisposed check but before _server = server, leaving the D-Bus connection running and never stopped (leak) while the instance is already disposed. Guard against this by re-checking IsDisposed immediately after assignment and by ensuring the queued UI action only runs for the same server instance. src/Uno.UI.Runtime.Skia.X11/Accessibility/X11Accessibility.cs:821
DisposeCore() clears _elementsByHandle, but _elementsSnapshot is left pointing at the last published dictionary, which keeps UIElements alive after the window closes. Reset the snapshot as part of disposal to avoid retaining the visual tree unnecessarily.
…leak
From the automated PR review:
- ComboBox items are enumerated only while the dropdown is open (with the
selected value always exposed as text), instead of eagerly walking Items on
every rebuild — a large/virtualized ItemsSource would otherwise materialize.
- Close the startup/disposal race: _server assignment (D-Bus continuation
thread) and DisposeCore (UI thread) now share a lock, so a server that starts
as the window closes is always stopped rather than leaked.
- DisposeCore resets the published element snapshot, so UIElements are not
retained after the window closes.
Co-Authored-By: Claude Fable 5 <[email protected]>
Thanks for the review — addressed in afe7185 (and the coordinate follow-up f4e3700). Point by point:
🟡 ComboBox item enumeration (X11Accessibility.cs:412) — fixed. Items are now enumerated only while the dropdown is open; when closed the combo just exposes its selected value as text (via SelectionBoxItem, matching the macOS head) and stays expandable. This avoids materializing a large/virtualized ItemsSource on every rebuild. A rebuild is coalesced-triggered when the dropdown opens.
🔵 Startup/disposal race (X11Accessibility.cs:106) — fixed. _server is assigned on the D-Bus connect continuation (not the UI thread) while DisposeCore runs on the UI thread; they now share a lock, so a server that finishes starting as the window closes is stopped rather than leaked. The IsDisposed check and the assignment are inside the same lock that DisposeCore takes to read/null _server.
🔵 Retained UIElements on dispose (X11Accessibility.cs:821) — fixed. DisposeCore now also resets the published _elementsSnapshot (the reader-thread lookup dictionary), so the visual tree isn't retained after the window closes.
🟡 Value interface "advertised but not dispatched" (AtspiServer.cs:463) — this one is a false positive: the AT-SPI org.a11y.atspi.Value interface is entirely property-based (CurrentValue, MinimumValue, MaximumValue, MinimumIncrement), served through org.freedesktop.DBus.PropertiesGet/Set — it has no D-Bus methods, so there is nothing to route in the method-dispatch switch. Verified against a real client: Atspi.Value.set_current_value writes and reads back correctly over the bus (a slider driven 0 → 2414, read back 2414).
Tests (X11Accessibility.cs:72) — fair point. The whole contract is currently verified headless (Xvfb + dbus + at-spi2-core) with an external AT-SPI client exercising read + write + live events; Uno.UI.RuntimeTests doesn't reference the X11 head today, so there's no obvious home for an in-harness test. Happy to (a) add a deterministic AtspiRoleMap unit test, and/or (b) contribute the container-based AT-SPI smoke as a CI job — whichever fits how you'd like Linux-only a11y covered. Guidance welcome.
All changes re-verified against the headless AT-SPI client after the fixes (EditableText write + read-back, Value set + read-back, checkbox toggle via Action, live state/property signals; extents shift correctly when the window moves).
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new AT-SPI D-Bus server currently violates the org.freedesktop.DBus.Properties.GetAll contract by always returning an empty dictionary, which can break AT-SPI client discovery/property reads.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the seven-file backend at afe71854ac40 and exercised the unchanged AtspiServer/AtspiNode source over a real private Linux D-Bus session, against the pinned at-spi2-core interface definitions. Two protocol defects need correction:
P1: text operations split supplementary Unicode characters. For A\U0001F600B, CharacterCount returns 4 rather than 3, GetText(1, 2) returns U+FFFD rather than the supplementary character, and DeleteText(1, 2) reports success while delivering UTF-16 units 0041 DE00 0042 to the write target. That is a lone low surrogate, not AB. Map the protocol's character offsets to UTF-16 indices consistently for count/read/edit operations; whole-string retrieval and the ASCII control both succeeded, so this is specifically the offset handling rather than a general transport problem.
P2: GetPosition/GetSize have the wrong D-Bus output signature. Both real replies advertise (ii), but Component.xml defines two separate integer outputs, ii. GetExtents is the method that returns a struct. Also, screen-relative and window-relative GetPosition requests return the same coordinates because the coordinate-type argument is ignored; the other coordinate-taking Component methods need consistent handling too.
The protocol run also confirms the existing GetAll finding: a populated Accessible node returns an empty property dictionary. I did not duplicate that inline. Conversely, the missing Value-dispatch objection is not valid for this protocol: Value.xml defines properties, not methods, and the actual Properties.Get/Set path changed CurrentValue from 5 to 12 in the control case. Existing reviewers' thread states were preserved.
Validation scope: actual Linux D-Bus transport and exact server dispatch/serialization, with a node-only synchronous write target and a logging adapter. The dispatcher was attached directly; registry discovery, actual X11 UI peer construction/provider mutation and Orca were not exercised. This is not full cross-head behavioral-parity or end-to-end screen-reader approval. The isolated container/image were removed and the initially stopped Docker engine was restored to stopped.
- Text/EditableText/CharacterCount treated AT-SPI character offsets as
UTF-16 indices, so astral characters (surrogate pairs) skewed counts
and partial operations could split a pair: 'A\U0001F600B' reported
CharacterCount=4 and DeleteText(1,2) produced a lone low surrogate.
Offsets are now mapped code-point -> UTF-16 (Utf16Index/CharacterCount
helpers, clamping at the ends, never splitting pairs).
- GetPosition/GetSize replied '(ii)' (a struct); Component.xml declares
two separate out arguments, so the reply signature is now 'ii'
(GetExtents keeps its declared '(iiii)' struct).
Verified: project compiles; the offset mapping is covered by a
standalone check reproducing the review's probe (count=3, GetText(1,2)
returns the intact emoji, DeleteText(1,2) yields 'AB', insert at
character 2 lands after the pair, offsets past the end clamp).
Addresses the 2026-09-14 review (P1, P2).
Co-Authored-By: Claude Fable 5 <[email protected]>
GetInterfaces advertises Text whenever HasText is true, but this handler implements only GetText and returns UnknownMethod for the rest of the AT-SPI Text contract. Clients that use methods such as GetCaretOffset, GetCharacterAtOffset, or GetTextAtOffset cannot consume these nodes. Implement the required methods or do not advertise Text.
Count all selected children in GetNSelectedChildren
GetNSelectedChildren returns 1 whenever any child is selected rather than the number of selected children. This is wrong for multi-selection controls and makes the published AT-SPI selection state inconsistent with GetSelectedChild/IsChildSelected. Count all selected children.
The requested AT-SPI coordinate type is discarded here. Contains and GetAccessibleAtPoint therefore interpret window- or parent-relative coordinates as screen coordinates, while extents are always returned in screen space. Convert the input/output according to AT-SPI_COORD_TYPE_* instead of ignoring the value.
Use consistent physical or logical units for bounds
AppWindow.Position is in X11 screen pixels, while the X11 host divides native window dimensions and pointer coordinates by RasterizationScale before exposing XAML/visual coordinates. Adding the unscaled visual offset and size to the physical origin produces incorrect AT-SPI bounds on HiDPI displays (for example, a scale of 2 reports half-width controls at the wrong position). Convert both client offsets/sizes and the origin to the same coordinate units.
This issue also appears on line 537 of the same file.
AtspiNode.Offscreen defaults to false, and this initializer never uses element.Visual.IsVisible. Elements that are already Hidden or Collapsed when the tree is built are therefore advertised with AT-SPI visible/showing states and remain navigable as if rendered.
This updates the cached description but emits no AT-SPI event. A runtime HelpText change therefore leaves clients with the old Accessible.Description until some unrelated tree rebuild. Emit the corresponding PropertyChange for accessible-description after updating the node.
Support selection for list controls or stop advertising it
ReplyInterfaces advertises Selection whenever a node has selectable children, which includes ListBox/ListView, but this write target rejects every non-ComboBox container. Consequently AT-SPI SelectChild always returns false for list controls even though they advertise selection support; route the operation through the selector/item provider or do not advertise the interface until it is supported.
Resolves X11XamlRootHost.cs (keep master's IX11Renderer + this branch's
accessibility members and master's BackgroundColor) and implements the
new SkiaAccessibilityBase.UpdateRoleDescription abstract member as a
no-op, matching Win32Accessibility.
Co-Authored-By: Claude Fable 5 <[email protected]>
Introspect hardcoded '<node/>' for every node, so clients doing dynamic
discovery saw an empty interface list despite the object serving
Accessible/Component/Action/Value/Text/etc. The interface set now comes
from one InterfaceNames helper shared with GetInterfaces, so the two can
never disagree; the introspection XML additionally lists Properties and
Introspectable.
Co-Authored-By: Claude Fable 5 <[email protected]>
Every rebuild reset _nextPath and reassigned paths in DFS order, so a
client holding a cached object reference could silently resolve to a
different control after any tree change — including routing a write to
the wrong element. Paths are now allocated once per element identity
(Visual.Handle) in maps that persist across rebuilds; data-only combo
items (no container element) key on the owning combo's handle plus item
index. The maps are only cleared on dispose.
Co-Authored-By: Claude Fable 5 <[email protected]>
@ramezgerges FYI: I force-pushed the branch (head is now 1c24cd63c0). Only the Oct-28 merge commit's message changed (merge: resolve conflict with upstream master → chore: merge upstream master into feature/x11-atspi-parity) so the conventional-commit check passes. The tree is identical, no code or docs changed. "Uno.UI - docs" is green on the new head. If you have the branch checked out locally, please re-fetch before pushing.
@egarim thanks, I went through the seven commits against my Oct 27 list, on head 1c24cd63c0, and started a CI run on it. The last full run was on Oct 21.
The seven fixes
All seven address what I raised:
coord_type on outputs (79139747eb): TranslateFromScreen mirrors TranslateToScreen exactly. The application root carries the frame's client-area bounds (ApplyFrameBounds), so window-relative replies are measured from the right origin. The text extents read coord_type after their offsets, matching Text.xml.
Live regions (cc8414586c): the override is gone and the base handles it, as on macOS.
Stale focus (a4fccf1ee4): focused 0 is sent only while the old node is still published, then both sides are cleared.
List selection (a3c7502917): one gap. A multi-select ListBox falls into selector.SelectedItem = item, which replaces the selection instead of adding to it, because only ListViewBase takes the SelectedItems.Add path. ListBox.SelectedItems can take the same path.
Rebuild on InvalidatePeer (09b9db1859): only elements that aren't published yet queue a rebuild.
Read-only ranges (b9344db4ce): writes are rejected, and the range's IsReadOnly is now captured on the node.
DPI (2300282db8): XamlRoot.Changed queues a rebuild when the scale moves, and the handler is detached on dispose.
Copilot's four open threads
Before merge:
The PR description is out of date on coordinates since (1). "Geometry: screen-absolute extents…" and the known limitation "GetExtents/GetPosition always return screen coordinates" should now say that coord_type is honoured.
No retry after a failed start (X11Accessibility.cs, StartServerSafely). When TryStartAsync returns null, nothing tries again unless the desktop's a11y status toggles. If the registry isn't up yet at login, the app stays invisible to Orca for the whole session. A bounded retry with backoff while AtspiEnablement.IsEnabled stays true would cover it.
Small, can be here or a follow-up:
Hit testing returns hidden nodes.FindAccessibleAtPoint / Contains compare unclipped bounds and ignore Offscreen, so a point in the scrolled-out part of content can return a hidden child. Skipping Offscreen children in FindAccessibleAtPoint is a one-line fix.
Follow-up:
Introspect emits empty interface elements. This is the same item as in my smaller list. Orca and libatspi don't need it, so I'd track it as a follow-up issue.
The smaller items from my Oct 27 comment are still open, and none of them blocks the merge.
@morning4coffe-dev both of your Sep 14 threads are now covered. The UTF-16 offsets and the ii signatures were fixed in 5145645277, and coord_type on the output side in 79139747eb. I'm resolving them; could you re-review when you get a chance?
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A moderate active issue remains because editable ComboBox nodes advertise AT-SPI text editing even though the queued write path invokes a SetValue implementation that always throws.
🎉 Congratulations on getting your very first pull request merged into Uno Platform! This is a huge milestone — you are now officially part of the community of contributors helping shape the future of cross-platform .NET development, and your code will reach developers and apps all over the world. 🌍
We are genuinely grateful for the time and care you put into this contribution. Every PR — big or small — makes Uno Platform better for everyone, and we hope this is the first of many. We cannot wait to see what you build next! 🚀
As a small thank-you, we would love to send you some swag so you can wear your contributor status with pride. And if you have any feedback or ideas on how we can make contributing to Uno Platform even better, please open a feedback issue — we truly value your perspective.
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
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.
GitHub Issue: closes #24380
Discussed in #24256: maintainers confirmed a Linux AT-SPI backend is in scope and suggested mirroring the macOS seam.
PR Type:
✨ Feature
What changed? 🚀
Adds a Linux / X11 AT-SPI2 accessibility backend to
Uno.UI.Runtime.X11. Previously the X11 head rendered to the screen but published no accessibility tree, so Uno apps were invisible to Orca and to AT-SPI-based automation.New
src/Uno.UI.Runtime.X11/Accessibility/:AtspiServer: discovers the accessibility bus (org.a11y.Bus.GetAddress), registers throughorg.a11y.atspi.Socket.Embed, and serves each node over D-Bus withTmds.DBus.Protocol(already referenced by the head). Interfaces:Accessible,Component,Application(root),Action,Value,Text,EditableText,Selection, plusPropertiesandIntrospectable. Signals followEvent.xml:state-changed,property-change,children-changed,selection-changed,text-changed,text-caret-moved,text-selection-changed,window:activate/deactivateandannouncement.X11Accessibility : SkiaAccessibilityBase: builds anAtspiNodetree from the automation peers (Raw elements and popup wrappers are flattened), enriched fromAriaMapperand the automation providers. It turns the base class's update, focus and child hooks into signals, and implements the write path (IWriteTarget), which drives the real control through its provider on the UI thread.AtspiEnablement: follows the desktop'sorg.a11y.Status(IsEnabled || ScreenReaderEnabled) and starts or stops the bridge live, so no tree is built or published while accessibility is off. Only the status watcher stays connected. Once a bridge has run, the router's tree hooks stay installed, as on the other heads. There is no app-level opt-out or force-on switch.AtspiTextSegmentation: AT-SPI offsets count characters (code points), not UTF-16 units. This maps them and finds character, word and line boundaries for theTextinterface; sentences are approximated by lines.AtspiRoleMap:AutomationControlTypeto AT-SPI role ids, matchingatspi-constants.h. Unmapped types fall back topanel.Host wiring mirrors the macOS head:
X11XamlRootHostimplementsIAccessibilityOwnerand becomes the router's active owner onFocusIn,AccessibilityRouteris initialized inX11ApplicationHost, and its tree notifications are enabled once the AT-SPI server is up.What a screen reader gets:
EditableText.showingderived from the clipped bounds.Component.GrabFocus.Action.DoAction,Value.CurrentValue,EditableText(set, insert, delete), caret and text selection, andSelection.SelectChild, all through the providers. Text edits and caret or selection moves are applied to the control's current text, so quick successive requests do not overwrite each other. Writes to disabled controls, read-only ranges and non-finite values are ignored; the reply only confirms the request was queued (see Notes).AnnounceOnPlatformandLiveSettingchanges, polite or assertive.Also included: the
Accessibility_Showcasesample (Automation category), with one section per screen-reader capability; unit tests for the text offsets and role ids; and docs updates.PR Checklist ✅
Accessibility_Showcasemanual test sample.Given_AtspiTextSegmentationandGiven_AtspiRoleMapinUno.UI.UnitTests.AtspiTextSegmentation.csandAtspiRoleMap.csare compile-linked the same way asX11PointerCoordinateMath.5086ca8185against Orca 46 and libatspi on Ubuntu 24.04, and pushed the resulting fixes (0af09bef81), theAccessibility_Showcasesample (ae1dcd0d13) and theNO_AT_BRIDGEremoval (54d125dbd2).features/accessibility/index.md(Linux row and limitations note, how it works),automation-peers.md(Linux in the Skia architecture) andtesting-with-screen-readers.md(activation, inspecting the AT-SPI tree, a common issue).Screenshots Compare Test Runresults: no visual change.Accessibility_Showcaseis a manual test, which snapshot runs skip, and Screenshot Comparison passed on67e2c46fa5.Notes for reviewers
Cache.GetItemsis not implemented. Clients log adbind-WARNINGand fall back to per-object queries.panel.Actionis exposed for buttons, toggles, combo boxes and selectable items only, not for links or expanders.SelectionsupportsSelectChildonly.CutTextandPasteTextare not implemented, andCopyTextdoes nothing.Textcharacter and range extents report the whole text box (no per-glyph layout), andGetOffsetAtPointreturns -1.Component.GetExtents/GetPositionalways return screen coordinates, whatevercoord_typeis requested. Hit-testing does honourcoord_type.ComboBoxItemcontainer) get paths keyed by index, so a held reference follows the index rather than the item.IWriteTargetimplementation inX11Accessibility.Tmds.DBus.Protocolstays at the head's0.92.0. Two things worth knowing:MessageWriteris aref struct, so a by-value helper silently drops the message body, and 0.92 tears the connection down on an unhandled incoming call. Both are handled.🤖 Generated with Claude Code