Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130843

a11y: Qt sends AT-SPI signals with wrong DBus signature

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.8.1, 6.9.0 FF
    • 6.9.0 FF
    • None
    • Debian testing, qtbase self-compiled from git dev as of commit 4c0b45553862d3eff35906d02ea5e2afd9252bbd
    • Linux/Wayland, Linux/X11
    • fdf87fdce (dev), 5b258d745 (6.8)

    Description

      The AT-SPI2 XML specification specifies the DBus arguments signature for signal types to be "siiva{sv}".

      XML spec: https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/33b45aea12331335eaeb7edb45132466114013e9/xml/Event.xml

      Qt however incorrectly sends arguments that correspond to a "siiv(so)" argument signature instead.

      Sample steps to reproduce:

      1) Adjust at-spi2-core ( https://gitlab.gnome.org/GNOME/at-spi2-core using git main as of commit 33b45aea12331335eaeb7edb45132466114013e9) to print the DBus signature for received signals:

      $ git diff
          diff --git a/atspi/atspi-event-listener.c b/atspi/atspi-event-listener.c
          index 20ba0436..0cfe8dd0 100644
          --- a/atspi/atspi-event-listener.c
          +++ b/atspi/atspi-event-listener.c
          @@ -28,6 +28,8 @@
          #include <string.h>
          #include <strings.h>    +#include <stdio.h>
          +
          /**
          * AtspiEventListener:
          *
          @@ -1110,6 +1112,8 @@ _atspi_dbus_handle_event (DBusMessage *message)    g_assert (strncmp (category, "org.a11y.atspi.Event.", 21) == 0);    +  printf("sender: %s, signature: %s\n", sender, signature);
          +
          if (strcmp (signature, "siiv(so)") != 0 &&
              strcmp (signature, "siiva{sv}") != 0)
              { 

      2) run a AT-SPI (pyatspi) event listener to print "object:state-changed" events

      #!/usr/bin/python3
      
      import pyatspi
      
      
      def listener(e):
          try:
              if e.host_application.name != 'standarddialogs' and e.host_application.name != 'gtk3-demo':
                  return
          except:
              return
          print(e)
      
      
      pyatspi.Registry.registerEventListener(listener, 'object:state-changed')
      pyatspi.Registry.start()

      To better see only relevant events, this is limited to the "standarddialogs" Qt sample app and "gtk3-demo" sample application, for comparison.

      3) start the "standarddialogs" Qt sample app from qtbase and move focus using the Tab key, check the output of the pyatspi script started in step 2.

      4) start the GTK 3 demo app called gtk3-demo app and move focus around using the Tab key, check the output of the pyatspi script started in step 2.

       

      Actual result:

      In step 3 (with Qt sample app), the signature is incorrect, e.g.:

          sender: :1.59, signature: siiv(so)
          object:state-changed:focused(1, 0, [button | QInputDialog::getText()])
                  source: [button | QInputDialog::getText()]
                  host_application: [application | standarddialogs]
                  sender: [application | standarddialogs] 
      

      In step 4 (with GTK sample app), the signature is as expected:

          sender: :1.57, signature: siiva{sv}
          object:state-changed:focused(1, 0, 0)
                  source: [button | Run]
                  host_application: [application | gtk3-demo]
                  sender: [application | gtk3-demo]

      Further information

      This was discussed in the KDE accessibility matrix room earlier, where it was mentioned that clients/client libraries currently have to work around this.

      Code pointer to one example in xalia that was given:
      https://github.com/madewokherd/xalia/blob/4bdb54ead250ffe956ef32f70ddda1265f3bc01d/xalia/AtSpi2/DBusUtils.cs#L311-L339

      The AT-SPI2 XML spec wasn't always correct (i.e. not always in line with the actual implementation/expectation), so maybe the spec was just wrong earlier...

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes