Android: Fix touchDown event coordinates

In the touchAdd method, the mapped touch point is divided by the
platform integration screen size.
In order not to mix different coordinate systems, we should use
platformWindow to correctly calculate global position of touch event.

Pick-to: 6.9 6.8
Task-number: QTBUG-130576
Task-number: QTBUG-127925
Change-Id: Ic7653a60fb3def181f29a3e28b963878dc54a99e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Bartlomiej Moskal 2025-03-21 11:09:06 +01:00
parent c04b95cb59
commit 01d25533b4

View File

@ -289,7 +289,12 @@ namespace QtAndroidInput
return;
}
QPointF mappedTouchPoint = window->mapToGlobal(QPointF(x, y));
QPointF mappedTouchPoint;
if (window->handle())
mappedTouchPoint = window->handle()->mapToGlobalF(QPointF(x, y));
else
mappedTouchPoint = window->mapToGlobal(QPointF(x, y));
QWindowSystemInterface::TouchPoint touchPoint;
// Start numbering touch points from 1
touchPoint.id = id + 1;