diff options
author | Mike Gorse <mgorse@suse.com> | 2021-05-22 15:39:29 +0000 |
---|---|---|
committer | Mike Gorse <mgorse@suse.com> | 2021-05-22 15:39:29 +0000 |
commit | 9c98153011c1e046ba48db29a58ad1c2c995173c (patch) | |
tree | 4f7e60e1c3cb0a2055825ca9c2b61c218f68a58b | |
parent | 52b6691b38900a922ccd5c6cbb70d1ef00090e36 (diff) | |
parent | 8d514cc1b8456224fa687bc0e32d26c3b4b994c0 (diff) | |
download | at-spi2-core-9c98153011c1e046ba48db29a58ad1c2c995173c.tar.gz |
Merge branch 'benzea/xwayland-on-demand-support-for-root-apps' into 'master'
bus: Set X root property when Xwayland starts on-demand
Closes #34
See merge request GNOME/at-spi2-core!56
-rwxr-xr-x | bus/00-at-spi | 10 | ||||
-rw-r--r-- | bus/meson.build | 8 |
2 files changed, 18 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" diff --git a/bus/meson.build b/bus/meson.build index f6c32c99..3504fb31 100644 --- a/bus/meson.build +++ b/bus/meson.build @@ -6,6 +6,7 @@ accessibility_conf.set('DATADIR', atspi_datadir) busconfig_dir = join_paths(atspi_datadir, 'defaults/at-spi2') session_dir = join_paths(atspi_sysconfdir, 'xdg/autostart') +xwayland_session_dir = join_paths(atspi_sysconfdir, 'xdg/Xwayland-session.d') configure_file(input: 'accessibility.conf.in', output: 'accessibility.conf', @@ -27,6 +28,13 @@ configure_file(input: 'at-spi-dbus-bus.service.in', configuration: libexec_conf, install_dir: systemd_user_dir) +if x11_dep.found() + # Note: It is safe to always install it. However, we only need this on + # systemd enabled machines where Xwayland may be started on-demand. + install_data('00-at-spi', + install_dir: xwayland_session_dir) +endif + launcher_args = [ '-DSYSCONFDIR="@0@"'.format(atspi_sysconfdir), '-DDATADIR="@0@"'.format(atspi_datadir), |