So far, only accessible interfaces of roles QAccessible::Dialog and QAccessible::Window were taken into account when trying to find the top-level window in order to calculate the window-relative coordinates relative to that one. However, an app doesn't necessarily need to have any such widget/ window as it's top-level object, but can have any widget there. Therefore, consider any a11y object that is a direct child of the application's a11y object a top-level window as well. For example, in the spinboxes example (qtbase/examples/widgets/widgets/spinboxes/spinboxes), the top-level widget is a QGroupBox, which has an accessible role of QAccessible::Client, which maps to ATSPI_ROLE_FILLER for AT-SPI on Linux. Since that's the top-level widget, window-relative coordinates should be calculated relative to it. (Without this change in place, screen coordinates would be used for the window-relative coordinates as well, as found by the script attached to QTBUG-106527.) Also deduplicate a bit and just have a single loop instead of the extra check on the interface itself at the beginning. Fixes: QTBUG-106527 Pick-to: 6.5 Change-Id: I8d2a00bcc22c71d696e4f48233afddc80e93bc1b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 1b0e76f514e9a460e1d78a813813c0909838a03e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%