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]:

    <!--
        AtspiVersion: You should return "2.1" here.

        This was intended to be the version of the atspi interfaces
        that the application supports, but atspi will probably move to
        using versioned interface names instead.  Just return "2.1" here.
    -->
    <property name="AtspiVersion" type="s" access="read"/>

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] 2d83e3a6df/xml/Application.xml (L19-26)
[2] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/95

Pick-to: 6.9 6.10
Change-Id: I0d849d5d6d160c48fd4fc2d443e4fde43cde5606
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Michael Weghorn 2025-05-20 16:03:07 +02:00 committed by Volker Hilsheimer
parent db07a03874
commit 6cca30bb11

View File

@ -1513,6 +1513,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)));