summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-26 13:22:36 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-03-01 11:05:53 +0000
commitdefd302f64f213a8764875a88788dbcea76d66f0 (patch)
tree1d705686dd699677ef43fc5fcf32e0ea7499bb73
parentbd43dcae8a0761f265a4b1a10e34f301fc49f311 (diff)
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>
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index b0772e7a96..841e4f8f41 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -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);
}