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

a11y: Docked QDockWidget reports incorrect role and window-relative position via AT-SPI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.10.0 Beta3, 6.11.0 FF
    • 6.11.0 FF
    • None
    • Debian testing, qtbase self-compiled from git dev as of commit dd1c5723382308d5317f402048de07e0854450a6
    • Linux/Wayland, Linux/X11
    • b126ada30 (dev), 1fe2adea7 (dev), 62f101c7d (dev), a99a99ea7 (dev), 58c4b4e9c (6.10)

    Description

      When a QDockWidget is docked (i.e. not floating), it is not a top-level window. Therefore, it should not report a top-level window role on the accessibility level and its window-relative position should be reported relative to the top-level window (QMainWindow) in which it is contained accordingly. That is however not the case at the moment, which e.g. breaks Accerciser's feature of highlighting the area of the currently selected object on screen (with environment variable ACCERCISER_WINDOW_MANAGER=kwin set in a Plasma Wayland session).

      This was initially observed with Dolphin, but can also be reproduced with this simple sample program:

      #include <QApplication>
      #include <QDockWidget>
      #include <QHBoxLayout>
      #include <QLabel>
      #include <QMainWindow>
      #include <QMenu>
      #include <QToolBar>
      #include <QToolButton>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
      
          w.setCentralWidget(new QLabel("Central Widget"));
      
          QDockWidget* dockWidget = new QDockWidget("Dock Widget", &w);
          dockWidget->setWidget(new QLabel("Label in dock widget"));
          w.addDockWidget(Qt::BottomDockWidgetArea, dockWidget);
      
          w.show();
          return a.exec();
      }
      

       

      Steps to reproduce:

      1. Build and run the above sample program
      2. start Accerciser
      3. select the "Dock Widget" object in Accerciser's treeview of the app's a11y hierarchy
      4. Switch to Accerciser's interface view and check the "Component" section.

      Actual result:

      As shown in the attached screenshot, the dock widget has the AT-SPI "frame" role which is for top-level windows only.

      The window-relative position is reported as (0,0), even though the parent-relative position within the actual top-window parent is correctly reported as (0, 64) (Exact value may depend on environment.)

       Expected result:

      QDockWindow should only report a top-level window role if it's floating, i.e. if it is an actual top-level window. If it's docked, window-relative coordinates should be relative to the QMainWindow it is contained in.

      Attachments

        For Gerrit Dashboard: QTBUG-138206
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: