diff options
author | Benjamin Berg <bberg@redhat.com> | 2021-05-19 15:08:42 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2021-05-19 15:14:26 +0200 |
commit | 8d514cc1b8456224fa687bc0e32d26c3b4b994c0 (patch) | |
tree | 20a73f33901cdd75934416eac07ff52d039dafd9 /bus/00-at-spi | |
parent | 1a7d59f174a66d2b46a7774c1f09154a94ea151c (diff) | |
download | at-spi2-core-8d514cc1b8456224fa687bc0e32d26c3b4b994c0.tar.gz |
bus: Set X root property when Xwayland starts on-demand
On wayland, the X11 server may not always be running so that
at-spi-bus-launcher cannot set it when it is starting.
This is usually not a big problem, as applications can retrieve the a11y
bus address by querying the session bus. Unfortunately, there may be
exceptions such as applications that are run as a different user.
We can easily solve this problem by setting the X11 root property when
the Xwayland server is started. To do so, install a simple script to
/etc/xdg/Xwayland-session.d/ that queries the session bus and sets the
root property.
This script is only needed when Xwayland is started on-demand, which can
only happen on systemd enabled sessions. However, it is always safe to
install, and there will be no severe side effects should the script be
running needlessly or failing.
Closes: #34
Diffstat (limited to 'bus/00-at-spi')
-rwxr-xr-x | bus/00-at-spi | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bus/00-at-spi b/bus/00-at-spi new file mode 100755 index 00000000..dc3bb605 --- /dev/null +++ b/bus/00-at-spi @@ -0,0 +1,10 @@ +#!/bin/sh + +# Copy a11y bus address from the DBus session bus to the X11 root property. +# This is useful when Xwayland is started on demand and if the user has an +# application with X11 access that does not have access to the session bus. + +ADDR="$( busctl call --user org.a11y.Bus /org/a11y/bus org.a11y.Bus GetAddress )" || exit 0 +ADDR="$( echo $ADDR | sed 's/s "\(.*\)"/\1/' )" || exit 0 + +exec xprop -root -format AT_SPI_BUS 8s -set AT_SPI_BUS "$ADDR" |