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
Pick-to: 6.8
Change-Id: I9352e809a4a62b15adcf279b00f2d07a72257012
Reviewed-by: Janne Roine <janne.roine@qt.io>
This commit is contained in:
Tuomas Vaarala 2020-08-18 14:26:35 +03:00
parent 9f4ba98a37
commit de2706fa35

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