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

New commits:
commit cec215e0e3adaf26c89c4ffbaa53f87481772f0c
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Mon Apr 4 11:25:22 2022 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Mon Apr 4 17:35:21 2022 +0200

    tdf#147523 Qt use inner QWidget to set pointer pos
    
    Regression from commit e63fe68fb1d0915b64fdf63f7fa6eed866fa3a0d
    ("Qt use asChild for pointer positioning"), which should just have
    been a cleanup for commit ca28826a087245686d7fca3ffc8ca1f03307924d
    ("tdf#131467 Qt set default position on first resize").
    
    And scale the requested position by the device scale factor.
    
    Change-Id: I50b3c628d22896e987d8cc2eaf5635cb12ba3464
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132518
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx
index a70b6616c0a7..6c2e4757f84a 100644
--- a/vcl/qt5/QtFrame.cxx
+++ b/vcl/qt5/QtFrame.cxx
@@ -883,7 +883,7 @@ void QtFrame::SetPointerPos(tools::Long nX, tools::Long nY)
 {
     // some cursor already exists (and it has m_ePointerStyle shape)
     // so here we just reposition it
-    QCursor::setPos(asChild()->mapToGlobal(QPoint(nX, nY)));
+    QCursor::setPos(m_pQWidget->mapToGlobal(QPoint(nX, nY) / 
devicePixelRatioF()));
 }
 
 void QtFrame::Flush()

Reply via email to