And again it's posing problem. As advised by svuorela on irc, here is a version that defers the trigger. This is probably even safer since that's what is committed upstream for the AT_SPI_BUS_ADDRESS environment variable case.
Samuel
--- a/src/platformsupport/linuxaccessibility/bridge.cpp +++ b/src/platformsupport/linuxaccessibility/bridge.cpp @@ -65,6 +65,16 @@ QSpiAccessibleBridge::QSpiAccessibleBrid { dbusConnection = new DBusConnection(); connect(dbusConnection, SIGNAL(enabledChanged(bool)), this, SLOT(enabledChanged(bool))); + // Now that we have connected the signal, make sure we didn't miss a change, + // e.g. when running as root or when AT_SPI_BUS_ADDRESS is set by hand. + // But do that only on next loop, once dbus is really settled. + QMetaObject::invokeMethod( + this, + [this] { + if (dbusConnection->isEnabled()) + enabledChanged(true); + }, + Qt::QueuedConnection); } void QSpiAccessibleBridge::enabledChanged(bool enabled)