Skip to content

BiVox v0.2.6 — focus resolution overhaul

Choose a tag to compare

@DirectX DirectX released this 02 Dec 05:18
· 14 commits to main since this release

BiVox v0.2.6 — focus resolution overhaul

Your nuc doctor output finally cracked the last layer: the whole pipeline
works (ASR committed "Раз, два, три, четыре, пять. Вышел зайчик погулять.",
rust worker healthy, editor present on the a11y bus) — but the injector's
auto-resolution returned focused app = '' on BOTH boxes.

Root cause (confirmed by experiment, not guesswork)

On GNOME 50 / GTK4 stacks, client apps frequently never expose
STATE_FOCUSED/STATE_ACTIVE
on their frames or widgets — verified locally:
even a freshly-launched gnome-text-editor (WM-given focus) shows
frame[showing] only, grabFocus via AT-SPI errors out, and Shell's
Introspect.GetWindows is access-denied. Focus events do fire on real
transitions, but only while the keyboard focus actually moves — a session
started after the user already switched to the editor sees nothing, because
the event was consumed before the patcher spawned. State-polling is simply
blind on this stack.

What v0.2.6 changes

  1. Persistent focus watcher (atspi_inject.py --watch): spawned by core
    at boot (when autostart_patcher is on), supervised & respawned on death.
    It captures every focus / object:state-changed:focused EVENT into
    $XDG_RUNTIME_DIR/bivox/focus.json (atomic replace, last_editable is
    never clobbered by non-edit focus moves). The injector now reads this
    fresh record FIRST — so clicking into an editor at ANY time before
    Right-Alt makes that editor the target. This is the architecture fix:
    events are reliable, states are not.
  2. Guaranteed pin target: autostart_patcher = "gnome-text-editor" (or
    any app name) resolves via find_app() + find_editable() with NO focus
    detection at all — verified working on both stacks. The ambiguity error
    message now prints this as the copy-paste fix.
  3. --probe mode: atspi_inject.py --probe dumps the single-pass a11y
    scan (frames/states/editable presence), shell's own focus node, and the
    watcher file state — one command to diagnose any future resolution issue.
  4. Single-pass scanner (scan_apps()): depth 35 (gnome-text-editor's
    SourceView nests ~27 deep — the old depth-9/600-budget probes literally
    could not reach the text widget), one walk per app collecting frames +
    editable-presence + focused-edit; ~1.7 s per full scan, reused by all
    three resolution paths instead of O(n·m) re-walks.
  5. Injector auto-loop bounded to ≤2 scans / ≤6 s (was: unbounded re-polling
    that could hang a session's injection leg for its whole lifetime).

Workaround available TODAY (before upgrading)

Set in /usr/share/bivox/config.toml:

autostart_patcher = "gnome-text-editor"

then systemctl --user restart bivox-core. Dictation will append into the
focused gnome-text-editor window regardless of focus detection. (Other apps:
put their a11y name — see bivox-ctl doctor / --probe output.)

Honest status

  • Watcher + pin + probe all verified on dev; live keyboard-focus capture
    could not be verified here
    because the dev screen is currently locked
    (shell holds modal focus — no client events). The nuc box is the test
    ground: after upgrade, click into the editor once, press Right-Alt — the
    watcher file makes it stick. If it still misses, --probe output will
    show exactly which link is cold.
  • Electron apps remain best-effort (their a11y trees are the problem, not
    focus); GNOME Terminal still refuses by design.

Assets

Asset Size
bivox_0.2.6_amd64.deb 7.9 MB
bivox-models-ru-en_0.2.6_all.deb 499 MB

Suites at tag: M3 13/13 · E2E 8/8 · M1 21/21 · M2 9/9.