AT_SPI_BUS property getting suppressed
Hello,
When running at-spi-bus-launcher --launch-immediately
several times in an X session, the first run creates the AT_SPI_BUS root X window property, but then the others drop it. The result is that when a user passes root with su -l
(thus clearing all environment variables) but sets DISPLAY=:0 and XAUTHORITY to make graphical applications to access X, dbus auto-triggers an at-spi-bus-launcher again, which sets the AT_SPI_BUS property, and from then on we have mayhem in atspi with two concurrent atspi stacks running.
This happens since 25f1cc6c ("bus-launch: Do not poke X11 to check at-spi-bus-launcher is running") which dropped the test for the AT_SPI_BUS
property made by already_running
, by delegating the exclusion test to the g_bus_own_name
call. But in that case on_bus_acquired
will be called anyway, and with --launch-immediately
it calls ensure_a11y_bus
which will start a bus and call XChangeProperty
, thus overwriting the property set by the first at-spi-bus-launcher
invocation! And when on_name_lost
is called it will exit the main loop and call XDeleteProperty
, thus clearing the AT_SPI_BUS
property (which isn't a so bad thing in this precise case since it'll be dead).
AIUI, the call to ensure_a11y_bus
should be moved to on_name_acquired
instead. I tried it and it seems to work fine, with a couple more fixes, which I'll submit.
Samuel