tdf#149816 qt a11y: Report position in screen coordinates
`QAccessibleInterface::rect()` is supposed to report the
geometry in screen coordinates [1].
`XAccessibleComponent::getLocationOnScreen` returns the
position in screen coordinates, so use that instead
of `XAccessibleComponent::getLocation`, which returns the
position relative to the parent.
With this in place, Accerciser correctly highlights
the area of the item curently selected in its treeview
of the LO a11y hierarchy.
[1] https://doc.qt.io/qt-6/qaccessibleinterface.html#rect
Change-Id: Iefb1e8792cd3ee720feafc81744e5e6ed6a949c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136781
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 3461ec1..5e66459 100644
--- a/vcl/qt5/QtAccessibleWidget.cxx
+++ b/vcl/qt5/QtAccessibleWidget.cxx
@@ -264,7 +264,7 @@ QRect QtAccessibleWidget::rect() const
return QRect();
Reference<XAccessibleComponent> xAccessibleComponent(xAc, UNO_QUERY);
awt::Point aPoint = xAccessibleComponent->getLocation();
awt::Point aPoint = xAccessibleComponent->getLocationOnScreen();
awt::Size aSize = xAccessibleComponent->getSize();
return QRect(aPoint.X, aPoint.Y, aSize.Width, aSize.Height);