qt_handleMouseEvent(): Scale coordinates.

Fix tst_qwindow::testInputEvents() to pass when High DPI scaling is in effect.

FAIL!  : tst_QWindow::testInputEvents() Compared values are not the same
   Actual   (window.mousePressLocalPos): QPointF(6,17)
   Expected (local)                    : QPointF(12,34)
.\tst_qwindow.cpp(771) : failure location

Task-number: QTBUG-46615
Change-Id: I1ccacc807f3390b6ab26a369d13fd7896e64cbca
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2016-02-26 13:22:36 +01:00
parent bd43dcae8a
commit defd302f64

View File

@ -857,7 +857,9 @@ Q_GUI_EXPORT void qt_handleMouseEvent(QWindow *w, const QPointF &local, const QP
{
bool wasSynchronous = QWindowSystemInterfacePrivate::synchronousWindowSystemEvents;
QWindowSystemInterface::setSynchronousWindowSystemEvents(true);
QWindowSystemInterface::handleMouseEvent(w, timestamp, local, global, b, mods);
const qreal factor = QHighDpiScaling::factor(w);
QWindowSystemInterface::handleMouseEvent(w, timestamp, local * factor,
global * factor, b, mods);
QWindowSystemInterface::setSynchronousWindowSystemEvents(wasSynchronous);
}