From d6dd6c34d44609e680e2501efca60d76a8063e53 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 16 Apr 2021 22:46:24 -0700 Subject: [PATCH] Fix AT_SPI_BUS for Xwayland apps run as root (#1821345) --- at-spi2-core.spec | 16 +++++++++++++++- xwayland-session-scriptlet | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 xwayland-session-scriptlet diff --git a/at-spi2-core.spec b/at-spi2-core.spec index 1714395..bf6e499 100644 --- a/at-spi2-core.spec +++ b/at-spi2-core.spec @@ -1,11 +1,14 @@ Name: at-spi2-core Version: 2.40.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Protocol definitions and daemon for D-Bus at-spi License: LGPLv2+ URL: http://www.linuxfoundation.org/en/AT-SPI_on_D-Bus Source0: http://download.gnome.org/sources/at-spi2-core/2.40/%{name}-%{version}.tar.xz +# scriptlet to set AT_SPI_BUS for XWayland apps that run as root (i.e. anaconda) +# https://bugzilla.redhat.com/show_bug.cgi?id=1821345 +Source1: xwayland-session-scriptlet BuildRequires: dbus-devel BuildRequires: gettext @@ -46,6 +49,8 @@ API documentation for libatspi. %install %meson_install +install -d %{buildroot}%{_sysconfdir}/xdg/Xwayland-session.d +install -m 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/xdg/Xwayland-session.d/00-at-spi %{find_lang} %{name} @@ -57,6 +62,12 @@ API documentation for libatspi. %dir %{_datadir}/defaults/at-spi2 %{_datadir}/defaults/at-spi2/accessibility.conf %{_sysconfdir}/xdg/autostart/at-spi-dbus-bus.desktop +# the 'logical' owner of this dir is gnome-settings-daemon, but g-s-d +# indirectly depends on this package, so depending on it to provide +# this directory would create a circular dependency. so we just co-own +# it instead +%dir %{_sysconfdir}/xdg/Xwayland-session.d +%{_sysconfdir}/xdg/Xwayland-session.d/00-at-spi %{_libdir}/libatspi.so.* %dir %{_libdir}/girepository-1.0 %{_libdir}/girepository-1.0/Atspi-2.0.typelib @@ -74,6 +85,9 @@ API documentation for libatspi. %{_libdir}/pkgconfig/atspi-2.pc %changelog +* Thu Apr 15 2021 Adam Williamson - 2.40.0-2 +- Install a scriptlet to fix AT_SPI_BUS for Xwayland apps run as root (#1821345) + * Mon Mar 22 2021 Kalev Lember - 2.40.0-1 - Update to 2.40.0 diff --git a/xwayland-session-scriptlet b/xwayland-session-scriptlet new file mode 100644 index 0000000..ba5a55a --- /dev/null +++ b/xwayland-session-scriptlet @@ -0,0 +1,3 @@ +#!/bin/sh + +xprop -root -format AT_SPI_BUS 8s -set 'AT_SPI_BUS' "$( busctl call --user org.a11y.Bus /org/a11y/bus org.a11y.Bus GetAddress | sed 's/s "\(.*\)"/\1/' )"