Add Orca extension for Wine accessibility

Publish the Wine Access protocol on Orca’s service connection and manage helpers per active Wine prefix. Add presentation, dialog capture, documentation, and tests.

Preserve the Cthulhu default and shared helper code. Document the single-reader limit and verify Orca cleanup leaves Cthulhu-managed helpers alone. Retain integration artifacts on exceptional failures.

Validation: 45 Orca unit tests passed; 11 existing test-environment checks passed; version metadata checks, Python compilation, and staged whitespace checks passed. Full Wine integration and live speech/braille remain unverified here because MinGW, Xvfb, and Orca are unavailable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Devin PraterandClaude Opus 5.5 authored and Storm Dragon committed 2026-10-21 15:42:13 -04:00
1 parent b57681d159
commit 418f671066
13 files changed
+1913 -3

No files matched your search

+102
View File
@@ -0,0 +1,102 @@
# Wine Access for Orca
An Orca 51 user extension that lets stock Orca use the Wine Access helper.
It publishes the Wine methods on Orca's own D-Bus service connection and
starts one helper per active Wine prefix, so Orca reads standard Wine
controls, native menus, Edit and Scintilla editing feedback, NVDA
Controller/Tolk speech and braille, UIA notifications, and dialog messages.
## Install
1. Build and install the helper as described in the main README.
2. Copy `orca/wine_access/` to `~/.local/share/orca/extensions/`.
3. Approve it with `orca --approve-extension wine_access` and restart Orca.
Approval records a hash of the package; approve again after any update.
Only one reader's helper can run on a Wine desktop/prefix at a time. Stop
Cthulhu's Wine helper before using Orca for that prefix, and disable this
extension before returning to Cthulhu. The extension does not stop or replace
Cthulhu-managed helpers; the helper's existing singleton guard rejects a
second instance. Installing these files alone does not change Cthulhu's
default endpoint or helper startup.
The extension looks for `wine-access.exe` in `$WINE_ACCESS_HELPER`,
`~/.local/libexec/wine-access/`, `~/.nix-profile/libexec/wine-access/`,
Home Manager's current generation, the NixOS user and system profiles,
`/usr/local/libexec/wine-access/`, `/usr/libexec/wine-access/`, and then
`PATH`.
## Endpoint
| | |
| --- | --- |
| Bus name | `org.gnome.Orca1.Service` (owned by Orca) |
| Object | `/org/gnome/Orca1/Service/WineAccess` |
| Interface | `org.gnome.Orca1.WineAccess` |
It implements `SpeakText`, `CancelSpeech`, `BrailleMessage`, `SpeakSsml`
(answering `ERROR_CALL_NOT_IMPLEMENTED`), `PresentAccessibleEvent`, and the
optional review methods `RegisterWineReviewProvider` and
`PresentWineReviewFocus`. The extension class has no Orca-decorated commands,
so Orca publishes nothing of its own at that module path.
## Helper supervision
Every two seconds the extension scans `/proc` for the user's Wine processes
(`wine`, `wine64`, their preloaders and Nix `.wine-wrapped` launchers),
ignoring Wine's own service processes and anything outside Orca's D-Bus
session and display. For each prefix (`WINEPREFIX`,
`STEAM_COMPAT_DATA_PATH/pfx`, or `~/.wine`) it starts:
```sh
wine-access.exe --reader orca --reader-path /org/gnome/Orca1/Service/WineAccess \
--reader-interface org.gnome.Orca1.WineAccess
```
with the program's own `WINELOADER`, display and bus, and
`ORCA_WINE_ACCESS_MANAGED=1`. A helper stops 10 seconds after its prefix
goes idle and restarts with exponential backoff after quick failures. Helpers
run in their own session and survive an Orca restart, so a newly loaded
extension retires a marked helper it did not start before starting its own.
Helper output is appended to
`~/.local/state/orca-wine-access/<prefix hash>.log`.
## Presentation
- Focus bursts are coalesced for 50 ms; repeated output within 100 ms is
dropped, and a state event that changes nothing audible stays quiet.
- Values, name and state changes are read for the focused source; selections
may come from another source in the focused window (combo box lists).
- `text` events are presented immediately and never merged, so repeated
characters are heard. Typed characters (`kind=8`) follow Orca's character
echo setting and are skipped when Orca's key echo already spoke the key.
Navigation, selection and deletion reports interrupt speech; single
characters use Orca's capitalization style.
- Password fields: values and editor feedback are never presented.
- Window titles are announced when they change, since Wine windows are not
visible to AT-SPI.
- Dialog messages: when review focus enters a new window with role `dialog`,
the extension captures it once with `CaptureWindow` and presents its
visible, unprotected labels after the focused control. Text that arrives
before that window's focus waits up to 300 ms for it.
## Tests
```sh
python3 -m pytest orca/tests/test_presenter.py orca/tests/test_manager.py \
orca/tests/test_service.py orca/tests/test_review.py
dbus-run-session -- xvfb-run -a python3 orca/tests/integration_test.py --build-dir build
```
The unit tests need `dasbus`. The integration test needs a built tree, Wine,
both MinGW compilers and `widl`; it hosts the extension's interface, presenter,
dialog reader and helper manager under Orca's bus name on a private display
and bus, lets the manager start the helper, runs the Notepad and controller
fixtures, and checks what Orca would present. To check the extension against
an installed Orca, run `orca/tests/orca_api_check.py` with Orca's Python
environment; it loads the extension and verifies the Orca APIs it calls.
Recorded presentations do not prove audible speech. For live acceptance,
open Wine Notepad with Orca running and check the window title, line,
word and character movement, selection and Backspace feedback, the File
menu, and the save dialog's buttons and message.