evdev: Do not take m_prevInvalid into account with absolute coordinates

If QT_QPA_EVDEV_MOUSE_PARAMETERS=abs is used to force qevdevmousehandler
to use absolute coordinates, the first event coordinates are incorrect
(0,0)

Fixes: QTBUG-86104
Change-Id: I9352e809a4a62b15adcf279b00f2d07a72257012
Reviewed-by: Janne Roine <janne.roine@qt.io>
(cherry picked from commit de2706fa35fa0d9f43d97b7aa6a7c30d1bb22e33)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tuomas Vaarala 2020-08-18 14:26:35 +03:00 committed by Qt Cherry-pick Bot
parent cba3c30047
commit 6a93c74a41

View File

@ -159,17 +159,15 @@ void QEvdevMouseHandler::sendMouseEvent()
if (!m_abs) {
x = m_x - m_prevx;
y = m_y - m_prevy;
}
else {
if (m_prevInvalid) {
x = y = 0;
m_prevInvalid = false;
}
} else {
x = m_x / m_hardwareScalerX;
y = m_y / m_hardwareScalerY;
}
if (m_prevInvalid) {
x = y = 0;
m_prevInvalid = false;
}
if (m_eventType == QEvent::MouseMove)
emit handleMouseEvent(x, y, m_abs, m_buttons, Qt::NoButton, m_eventType);
else