The communications mechanism for accessibility does not run through the user's session DBus; it runs in a separate bus just for accessibility purposes. The accessibility interfaces for DBus are very chatty; using a separate bus prevents the main session bus from getting too much traffic.
Throughout this document we will distinguish between the session bus and the accessibility bus.
This source directory bus contains a little daemon, at-spi-bus-launcher, which
launches the accessibility bus and manages its lifetime according to the user's
session.
The accessibility bus is just a separate instance of dbus-daemon or equivalent, like
dbus-broker. That bus allows communication using the accessibility interfaces defined
in the xml directory in this repository. It also has the accessibility registry —
registryd in this repository, which claims the name org.a11y.atspi.Registry in that
bus.
When a normal application starts up, it will want to find the accesibility bus, and
then contact the accessibility registry in that bus (registryd in this repository) to
inform the world that they are up and running. Finding the accessibility bus can then be
done on demand for normal applications, via the GetAddress method described below.
However, a screen reader is special: it needs to start up automatically during login, and immediatelly tell the accessibility registry (... via the accessibility bus) that it is running. If you need a screen reader to use your computer, you cannot easily launch it by hand if there is no screen reader already running!
That is, if a screen reader is turned on — and we assume it will start up turned on for
future sessions — we need to launch the accessibility bus unconditionally, not on
demand, at session startup. This is why at-spi-dbus-bus.desktop, described below, is an
XDG autostart file which runs at-spi-bus-launcher --launch-immediately,
but only if a certain GSettings key is turned on.
In summary, at-spi-bus-launcher will launch the accessibility bus under two situations:
-
On demand via the
GetAddressmethod; see below. -
Shortly after
at-spi-bus-launcherstarts up, if the gsettings keyorg.gnome.desktop.interface toolkit-accessibilityis set to true, due to theat-spi-dbus-bus.desktopXDG autostart file. -
The gsettings key
org.gnome.desktop.a11y.applications screen-reader-enabledis set to true.
This bus source directory has a configuration file for the dbus-daemon which will run
as the accessibility bus, and a helper daemon called at-spi-bus-launcher, which actually
starts that bus and makes its address visible to the user's session. The files are as follows:
-
accessibility.conf.in- template for the configuration for the accessibility bus, which gets installed in$(datadir)/defaults/at-spi2/accessibility.conf. -
at-spi-bus-launcher.c- Seeat-spi-bus-launcherbelow. -
at-spi-dbus-bus.service.in- template for a systemd user service to startat-spi-bus-launcher. -
org.a11y.Bus.service.in- template for a DBus user service to startat-spi-bus-launcher. -
at-spi-dbus-bus.desktop.in- template for a XDG autostart file to startat-spi-bus-launcherat session startup, only if theorg.gnome.desktop.interface toolkit-accessibilityGSettings key is turned on. -
00-at-spi- script to set theAT_SPI_BUSproperty on the X root window, for Wayland-based systems where XWayland is started on demand. That X window property is an alternative way of finding the address of the accessibility bus.
This is a tiny daemon which registers a service in the normal session bus, and which
can then be used to query the address of the actual accessibility bus. The daemon
claims ownership of the org.a11y.Bus name in the session bus, and exports a
single object, /org/a11y/bus, with two interfaces:
-
org.a11y.Bus- has a singleGetAddressmethod, which returns the address of the actual accessibility bus. Accessibility clients must use this address when creating their initial DBus connection. -
org.a11y.Status- has properties to query whether the accessibility bus is enabled and whether a screen reader is running.
at-spi-bus-launcher starts the separate dbus-daemon (or dbus-broker equivalent) for
the accessibility bus on demand. The following actions can cause it to launch:
-
Calling the
GetAddressmethod. The daemon gets launched and queried for its address; the method returns that. This is the normal way to start the accessibility bus. -
If
at-spi-bus-launcherwas run with the--launch-immediatelyoption, the accessibility bus launches as soon asat-spi-bus-launcheris able to claim ownership of theorg.a11y.Busname in the session bus. This is intended for session startup.