Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
6.0
-
None
Description
QGuiApplicationPrivate::processMouseEvent() sends a move event before a press or release, if the pos has changed since the last move. This causes issues if the move handler spins up a new event loop (e.g. DnD), as we will get a sequence of P, M, P, M, R, R, with PMR interleaved.
or, if the extra mouse move is inserted into the QPA queue, and the move handler spins up a new event loop, the release is delivered before the move handler is done, opening up for crashes due to using data that was released in the release handler.
See also: https://gist.github.com/torarnv/7bc8b7e981e96f6a7164365319e41d5b
QWidget::mouseMoveEvent (http://doc.qt.io/qt-5/qwidget.html#mouseMoveEvent) explicitly documents that:
QMouseEvent::pos() reports the position of the mouse cursor, relative to this widget. For press and release events, the position is usually the same as the position of the last mouse move event, but it might be different if the user's hand shakes. This is a feature of the underlying window system, not Qt.
So we should just remove the extra move event and deliver the position update as part of the press/release.
Attachments
Issue Links
- relates to
-
QTBUG-68970 Bad mouse move event
- Reported
-
QTBUG-111336 [REG 6.3->6.4] qtdeclarative/examples/quick/pointerhandlers/tabletCanvasDrawing.qml got broken again
- Closed
-
QTBUG-69422 Input Handling Changes in Qt 6
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-56479 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
307267,1 | WIP Remove fake move events from QGuiApplicationPrivate::processMouseEvent() | dev | qt/qtbase | Status: DEFERRED | -2 | 0 |