From 8e3d160e3f4fe9c95eca55ab69e491e64fd1a187 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 20 May 2025 16:03:07 +0200 Subject: [PATCH] a11y atspi: Support Application iface "AtspiVersion" property As the AT-SPI XML spec for the Application interface says, this should currently always be "2.1" [1]: This makes the expected value show up in Accerciser with pending merge request [2] in place instead of triggering a fallback path in Accerciser handling the null case for Qt applications. [1] https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/2d83e3a6dfa9e10243b296179a2ba85e37bdf1cc/xml/Application.xml#L19-26 [2] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/95 Change-Id: I0d849d5d6d160c48fd4fc2d443e4fde43cde5606 Reviewed-by: Volker Hilsheimer (cherry picked from commit 6cca30bb11c5d612c73e12e2dfcf1d473b17b6d4) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit a276ce620857aab15f60db17868abe86986f338b) --- src/gui/accessible/linux/atspiadaptor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp index 4f863c34cd9..5e38949ac2b 100644 --- a/src/gui/accessible/linux/atspiadaptor.cpp +++ b/src/gui/accessible/linux/atspiadaptor.cpp @@ -1512,6 +1512,12 @@ bool AtSpiAdaptor::applicationInterface(QAccessibleInterface *interface, const Q QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant(m_applicationId))); return connection.send(reply); } + if (function == "GetAtspiVersion"_L1) { + Q_ASSERT(message.signature() == "ss"_L1); + // return "2.1" as described in the Application interface spec + QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant("2.1"_L1))); + return connection.send(reply); + } if (function == "GetToolkitName"_L1) { Q_ASSERT(message.signature() == "ss"_L1); QDBusMessage reply = message.createReply(QVariant::fromValue(QDBusVariant("Qt"_L1)));