From efbcd597955d19abe838b4f9b544e41aed324214 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 4 Oct 2023 17:21:17 +0200 Subject: [PATCH] a11y: add runtime checking for xcb only calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This amends d23562da1c4cb525d4012bee55bd665c6cafef04 . Pick-to: 6.5 Task-number: QTBUG-117535 Change-Id: I33f97f3c26409a33c8a069f9dcdfe61bbd88e2ec Reviewed-by: Tor Arne Vestbø (cherry picked from commit 7e14e6c2d3bb5297eefa273d5a23836c931c7517) Reviewed-by: Qt Cherry-pick Bot --- src/gui/accessible/linux/dbusconnection.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/accessible/linux/dbusconnection.cpp b/src/gui/accessible/linux/dbusconnection.cpp index b4a8643474e..10bd10927ec 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); + } } }