-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The AT-SPI text injector currently uses Collection.GetMatches to find focused editable elements, but this method is:
- Not universally available - The
Collectioninterface isn't implemented by all AT-SPI registries - Overkill for the use case - Collection is for complex multi-criteria queries, not simple focus detection
- Fails on KDE Plasma - Even with at-spi2-core 2.58.1,
GetMatchesreturnsUnknownMethod
Error
Collection.get_matches failed: org.freedesktop.DBus.Error.UnknownMethod:
Method "GetMatches" with signature "(aiia{ss}iaiiasib)uib" on interface
"org.a11y.atspi.Collection" doesn't exist
Research Findings
Alternative Approaches (simpler and more portable)
-
Event-driven (most efficient):
listener.register("object:state-changed:focused"); // Receive ObjectRef of newly focused element directly
-
StateSet querying (most direct):
let state_set = accessible_proxy.get_state().await?; if state_set.contains(State::Focused) { // This element is focused }
-
Tree walking with state checks:
async fn find_focused_element(accessible: &AccessibleProxy) -> Option<AccessibleProxy> { let state_set = accessible.get_state().await.ok()?; if state_set.contains(State::Focused) { return Some(accessible.clone()); } // Recursively check children... }
KDE Plasma Requirements
Environment variables needed:
export QT_ACCESSIBILITY=1
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1Proposed Solution
- Replace
Collection.GetMatcheswith event-driven focus tracking - Use
StateSetqueries as fallback - Add runtime check for AT-SPI availability before attempting text injection
- Keep clipboard-based injection as fallback when AT-SPI
EditableTextunavailable
Affected Code
crates/coldvox-text-injection/src/injectors/atspi.rs(lines 87-120, 297-330)
Environment
- Nobara Linux 42 (Fedora-based)
- KDE Plasma 6 on Wayland
- at-spi2-core 2.58.1
- Rust atspi crate 0.29
Related
- CI tests now skip AT-SPI when feature not enabled (PR ci: split golden master and hardware integration tests into separate CI jobs #296)
- Original issue discovered while stabilizing real injection tests
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request