diff options
| author | Tuomas Vaarala <tuomas.vaarala@qt.io> | 2020-08-18 14:26:35 +0300 |
|---|---|---|
| committer | Tuomas Vaarala <tuomas.vaarala@qt.io> | 2024-10-30 16:13:15 +0000 |
| commit | de2706fa35fa0d9f43d97b7aa6a7c30d1bb22e33 (patch) | |
| tree | 200ae6aa9122142a377fee1168ed2502c7f78fc6 /src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp | |
| parent | 9f4ba98a3740c8e78175bdb08b85eefe4ff2ce79 (diff) | |
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>
Diffstat (limited to 'src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp')
| -rw-r--r-- | src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp index 8d98cb1e8cb..c22a85159b6 100644 --- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp +++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp @@ -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 |
