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:
parent
bd43dcae8a
commit
defd302f64
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user