Make unrelated atspi events filtering better.
This commit is contained in:
1 parent
41283a5d8d
commit
ce5f196956
25 files changed
+654
-41
No files matched your search
@@ -0,0 +1,77 @@
|
||||
# Background accessibility events
|
||||
|
||||
On Xorg, Cthulhu rejects known background control updates before resolving
|
||||
selected descendants or capturing their text, values, attributes and geometry.
|
||||
The native adapter owns this decision on the GLib thread. It uses the existing
|
||||
foreground window and epoch; there is no additional window ownership cache.
|
||||
|
||||
Events from another provider can be rejected using copied bus identities and
|
||||
libatspi's cached role and application name, without querying that provider.
|
||||
Events from another window on the same provider undergo the existing window
|
||||
correlation before content capture. Lifecycle invalidation still runs, but a
|
||||
background provider no longer clears another provider's cached document lines.
|
||||
|
||||
Window creation, activation, deactivation, destruction and defunct events keep
|
||||
their existing handling. Native alerts, notification daemons and supported
|
||||
Steam toasts retain their notification paths. Menu popups retain existing
|
||||
foreground checks. Same-provider autocomplete relations and tooltip candidates
|
||||
continue through the existing event-loop ownership checks; they do not acquire
|
||||
focus merely by passing the early filter.
|
||||
|
||||
When notification metadata or a detached document's containing window is
|
||||
unknown, the adapter retains the existing validation path. The optimization
|
||||
does not introduce an X11 ownership requirement for native Wayland sessions.
|
||||
|
||||
Orca's `src/orca/event_manager.py` was used as a reference for keeping global
|
||||
window monitoring and filtering noisy content events before presentation.
|
||||
|
||||
## Automated checks
|
||||
|
||||
Run from the repository root with the normal native build dependencies:
|
||||
|
||||
```sh
|
||||
go test ./... -count=1
|
||||
go test -race ./internal/atspi ./internal/app ./internal/review -count=1
|
||||
python3 tests/native_test_session.py env CTHULHU_NATIVE_BACKGROUND_EVENTS=1 CTHULHU_NATIVE_WAYLAND_POLICY=1 go test -race ./internal/atspi -run '^TestNative(BackgroundEventFiltering|WaylandForegroundPolicy)$' -count=1 -v -timeout=40s
|
||||
python3 tests/native_webscripts.py
|
||||
CTHULHU_NATIVE_BROWSER_TESTS=browser,tabs,live,tooltips python3 tests/native_browser.py
|
||||
go build -o /tmp/cthulhu-background-events ./cmd/cthulhu
|
||||
CTHULHU_BINARY=/tmp/cthulhu-background-events python3 tests/native_ownership.py
|
||||
```
|
||||
|
||||
The flood regression uses two real GTK providers, then two windows on one
|
||||
provider. Each burst changes the table selection 300 times. A private D-Bus
|
||||
monitor asserts that the rejected updates cause no Selection, Table, Text or
|
||||
Value interface calls. The explicit alert used as a completion marker is
|
||||
excluded from this content-query assertion. Returning to the noisy window must
|
||||
deliver its current table selection. The separate cache regression verifies
|
||||
that invalidation preserves other providers' document lines.
|
||||
|
||||
All native checks use disposable X servers and private D-Bus/runtime sockets.
|
||||
They do not replace the active desktop reader. Browser checks cover address
|
||||
suggestions, page controls, tabs, live regions and tooltips. Ownership checks
|
||||
cover GTK/Qt menus, a GTK menu popup, dialogs, same-process windows, empty
|
||||
workspaces and Brave window recovery. Notification checks preserve Steam toast
|
||||
capture while rejecting ordinary background Chromium text changes.
|
||||
|
||||
## Live acceptance
|
||||
|
||||
Private fixtures do not establish audible speech, physical Braille or actual
|
||||
FastSMRW update latency. After reviewing the diff, preserve the current debug
|
||||
log and rebuild/start the candidate through the normal local launcher when
|
||||
ready to replace the reader.
|
||||
|
||||
1. Read headings and lines in Brave while FastSMRW receives new items. Compare
|
||||
responsiveness with quiet periods. Background selection changes should not
|
||||
delay reading or take speech/focus ownership.
|
||||
2. Switch to FastSMRW and move through results. Confirm the current selection
|
||||
is spoken; open its Open Links popup, move between links, and close it.
|
||||
3. Switch between two windows from the same application. Open and close a
|
||||
dialog and a menu; confirm speech follows the active control.
|
||||
4. In Brave, type into the address bar and move through suggestions. Return to
|
||||
the page, switch tabs, and verify normal editing and reading still work.
|
||||
5. Check supported background notifications. If using Braille, confirm it
|
||||
follows the foreground control and still displays supported notifications.
|
||||
|
||||
Preserve a fresh log if lag or a missing announcement remains, with the time
|
||||
and the key or update that triggered it. Debug logs can contain private text.
|
||||
@@ -5,7 +5,7 @@ Build a separate test binary and run the focused checks:
|
||||
```sh
|
||||
go build -o /tmp/cthulhu-reading-descriptions ./cmd/cthulhu
|
||||
go test ./internal/preferences ./internal/presentation -count=1
|
||||
go test ./internal/app -run 'GUITable|PauseChunks' -count=1
|
||||
go test ./internal/app -run 'GUITable|GUIListTable|Context|PauseChunks' -count=1
|
||||
CTHULHU_BINARY=/tmp/cthulhu-reading-descriptions CTHULHU_PREFS_READING_ONLY=1 /usr/bin/python3 tests/native_preferences.py
|
||||
```
|
||||
|
||||
@@ -33,6 +33,19 @@ session:
|
||||
6. Check the modifier-key table and an application table to confirm their
|
||||
existing row and cell reading still works. Check the new descriptions on a
|
||||
physical Braille display when available.
|
||||
7. In FastSMRW, move through the timeline and switch workspaces to a terminal.
|
||||
Confirm no enter/leave container announcements occur. Also Tab into and out
|
||||
of Preferences tables and a native application's list: names, rows and cells
|
||||
should still be spoken, without a separate container exit announcement.
|
||||
8. In browser browse mode, navigate into and out of a list and data table.
|
||||
Confirm enabled context announcements still work, including during Say All.
|
||||
Switch to focus mode, browser chrome or another workspace and confirm there
|
||||
is no container exit announcement. Return to browse mode and check context
|
||||
is announced again when entering a container.
|
||||
9. Focus a button with a mnemonic, such as Preferences' Apply button. With
|
||||
pause breaks enabled, confirm the mnemonic follows as a separate chunk.
|
||||
Disable pause breaks and confirm the announcement is combined. Restore the
|
||||
preferred setting.
|
||||
|
||||
Automated checks do not establish audible speech, physical keyboard or Braille
|
||||
acceptance, or behavior of the installed reader.
|
||||
Reference in new issue
Block a user