diff options
author | Liang Qi <liang.qi@qt.io> | 2023-10-04 17:21:17 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-10-08 00:04:14 +0000 |
commit | 76e47f8c0131c59fd6c996f30c95500123a58725 (patch) | |
tree | c5820143f11422cea4ee99c6826e733544d4ba01 | |
parent | 8584881f9974ee76203b18ef2f524b39599279bf (diff) |
a11y: add runtime checking for xcb only calls
This amends d23562da1c4cb525d4012bee55bd665c6cafef04 .
Task-number: QTBUG-117535
Change-Id: I33f97f3c26409a33c8a069f9dcdfe61bbd88e2ec
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7e14e6c2d3bb5297eefa273d5a23836c931c7517)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit efbcd597955d19abe838b4f9b544e41aed324214)
-rw-r--r-- | src/gui/accessible/linux/dbusconnection.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/accessible/linux/dbusconnection.cpp b/src/gui/accessible/linux/dbusconnection.cpp index b4a8643474..10bd10927e 100644 --- a/src/gui/accessible/linux/dbusconnection.cpp +++ b/src/gui/accessible/linux/dbusconnection.cpp @@ -56,11 +56,13 @@ DBusConnection::DBusConnection(QObject *parent) if (c.interface()->isServiceRegistered(A11Y_SERVICE)) serviceRegistered(); - // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work - QString address = getAddressFromXCB(); - if (!address.isEmpty()) { - m_enabled = true; - connectA11yBus(address); + if (QGuiApplication::platformName().startsWith("xcb"_L1)) { + // In addition try if there is an xatom exposing the bus address, this allows applications run as root to work + QString address = getAddressFromXCB(); + if (!address.isEmpty()) { + m_enabled = true; + connectA11yBus(address); + } } } |