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.8
Task-number: QTBUG-130576
Task-number: QTBUG-127925
Change-Id: Ic7653a60fb3def181f29a3e28b963878dc54a99e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 01d25533b4f3c63c0484930e06664ad61ce24748)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Bartlomiej Moskal 2025-03-21 11:09:06 +01:00 committed by Qt Cherry-pick Bot
parent 0381e77205
commit 1bf44cc71f

View File

@ -284,7 +284,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;