1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Accessibility seam for the **self-drawn** Linux popups (X11 override-redirect
//! + Wayland layer-shell) — **SCAFFOLD ONLY** (0.11.0).
//!
//! ## Why this exists
//!
//! The native dbusmenu presenter ([`super::sni`]) is accessible over AT-SPI **for
//! free**: the SNI host draws a real native menu, so Orca walks it with no work
//! from muri. The moment muri draws its *own* styled popup (the X11 or Wayland
//! custom presenter), that free accessibility is gone — the compositor sees only
//! an opaque surface of pixels. To stay accessible, muri must publish a semantic
//! tree itself, exactly as it already does on macOS/Windows via `accesskit`.
//!
//! ## The plan (research doc §13)
//!
//! `accesskit_unix` implements the AT-SPI2 D-Bus interfaces via `zbus`. Crucially
//! **AT-SPI2 rides D-Bus, not the display protocol**, so the adapter is identical
//! under X11 and Wayland and never touches the compositor — it only needs a
//! logical `Window`-role node plus the menu items as `Role::MenuItem` /
//! `Role::MenuItemCheckBox`, and the app reporting focus. muri already builds this
//! exact tree for the macOS/Windows self-drawn menus behind the `a11y` feature;
//! the Unix adapter reuses it.
//!
//! **Known Wayland caveat:** `Adapter::set_root_window_bounds()` is X11-only (a
//! Wayland client can't read its window position), so absolute-screen AT
//! hit-testing won't be exact on Wayland — roles, text, focus, and actions all
//! still work. This is the documented, bounded cost of the styled path; it is a
//! reason the dbusmenu presenter stays the default where styling isn't essential.
//!
//! ## Status
//!
//! This is the **seam only**. Wiring `accesskit_unix` is a device-side task: it
//! adds the dependency (behind the `a11y` feature, `cfg(unix, not macos)`) and
//! feeds a `TreeUpdate` built from the popup's laid-out rows to the adapter on the
//! popup's own thread. Until then these hooks are inert no-ops so the X11/Wayland
//! popups run without accessibility rather than not at all.
// Scaffold seam: wired device-side under the `a11y` feature.
use crateMenu;
/// A handle to the AT-SPI adapter driving one self-drawn popup session. Owns the
/// (future) `accesskit_unix::Adapter`; created when a styled popup opens and
/// dropped when it dismisses, mirroring the macOS/Windows adapters' lifetimes.
pub