/
0051-fix-AT_SPI_BUS_ADDRESS-actually-working.patch
46 lines (40 loc) · 1.99 KB
/
0051-fix-AT_SPI_BUS_ADDRESS-actually-working.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From fb8dcd35cc5bbdcb8fbd6c047d048d499d19d907 Mon Sep 17 00:00:00 2001
From: Harald Sitter <sitter@kde.org>
Date: Mon, 18 Jul 2022 12:26:36 +0200
Subject: [PATCH 051/144] 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>
(cherry picked from commit be09628e151f26f602024bae6a957ffb27ac872d)
---
.../linuxaccessibility/dbusconnection.cpp | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection.cpp b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
index 17fc130ed8..0e5af37e3f 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection.cpp
+++ b/src/platformsupport/linuxaccessibility/dbusconnection.cpp
@@ -72,8 +72,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;
}
--
2.43.0