diff options
author | Harald Sitter <sitter@kde.org> | 2022-07-18 12:26:36 +0200 |
---|---|---|
committer | Harald Sitter <sitter@kde.org> | 2022-07-22 18:21:16 +0200 |
commit | be09628e151f26f602024bae6a957ffb27ac872d (patch) | |
tree | 2ccdf9aaa030f06eec13d286cfb971c1e067733e /src/gui/accessible/linux/dbusconnection.cpp | |
parent | 2f4204238c7ec6f52b688268b6d3b4b937630074 (diff) |
fix AT_SPI_BUS_ADDRESS actually working
the previous invocation wasn't working because QSpiAccessibleBridge
first needs to construct the connection before it can connect to the
enabledChanged signal that gets emitted as part of connectA11yBus,
effectively missing the signal emission because the connection wasn't
established by the time the emit happens. delay the signal emission
through the eventloop so the caller has time to connect to all signals.
https://bugs.kde.org/show_bug.cgi?id=452132
Change-Id: I1cf9fdd824b2c118cc6278b207aaaedeff259bb1
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Diffstat (limited to 'src/gui/accessible/linux/dbusconnection.cpp')
-rw-r--r-- | src/gui/accessible/linux/dbusconnection.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/accessible/linux/dbusconnection.cpp b/src/gui/accessible/linux/dbusconnection.cpp index b4a8643474..a970c2758b 100644 --- a/src/gui/accessible/linux/dbusconnection.cpp +++ b/src/gui/accessible/linux/dbusconnection.cpp @@ -38,8 +38,15 @@ DBusConnection::DBusConnection(QObject *parent) // If the bus is explicitly set via env var it overrides everything else. QByteArray addressEnv = qgetenv("AT_SPI_BUS_ADDRESS"); if (!addressEnv.isEmpty()) { - m_enabled = true; - connectA11yBus(QString::fromLocal8Bit(addressEnv)); + // Only connect on next loop run, connections to our enabled signal are + // only established after the ctor returns. + metaObject()->invokeMethod( + this, + [this, addressEnv] { + m_enabled = true; + connectA11yBus(QString::fromLocal8Bit(addressEnv)); + }, + Qt::QueuedConnection); return; } |