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.
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.
|For Gerrit Dashboard: QTBUG-56479|
|307267,1||WIP Remove fake move events from QGuiApplicationPrivate::processMouseEvent()||dev||qt/qtbase||Status: DEFERRED||-2||0|