vcl/qt5/QtAccessibleWidget.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a8132515babca53b1f1a464236e05f780cbfef3
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Jul 2 11:00:01 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Jul 2 12:41:21 2022 +0200

    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.wegh...@posteo.de>

diff --git a/vcl/qt5/QtAccessibleWidget.cxx b/vcl/qt5/QtAccessibleWidget.cxx
index 3461ec1ae38c..5e66459ce054 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);

Reply via email to