The attached application has a simple QTableWidget with some items that can be dragged into a drop-enabled QWidget subclass. On Linux, if you quickly drag an item from the table widget to the drop area, some drops are lost.
See the attached video for a demonstration of this bug.
Looking into this issue, I have discovered that an unexpected QEvent::Leave is sent about 200 ms after the start of any QDrag operation. This seems to be related to creation of the drag icon. The attached code prints out these leave messages. If you have already moved into the drop region by the time this event is sent, then the drop may fail.
It doesn't seem to matter whether you're dropping into the same Qt Application or dropping into any other linux application; the drop may be lost in either case. I have also tested this on the mac, and the unexpected QEvent::Leave still occurs, but it does not result in a failed drop.
I have been able to suppress this problem in two different ways by modifying Qt sources. I doubt that either one of these is appropriate as a true solution, but at least they may point the right person in a good direction.
(1) The problem goes away if you remove the following line from qsimpledrag.cpp, in QBasicDrag::startDrag():
If the drag icon is not shown, then the undesired Leave event is not sent, and the problem goes away. Of course, this isn't a good solution because it means that the drag icon is never shown.
(2) The problem also goes away if you remove the following lines from qxcbdrag.cpp, in QXcbDrag::move(const QMouseEvent *me): (somewhere around line 427, depending upon the revision of the source file)
This doesn't suppress the strange Leave event, but it prevents this Leave event from being translated into a DragLeaveEvent. This solution works fine, and everything else in the test App seems to work fine as well. I'm not sure what these lines are intended to do, but removing them doesn't have any bad effect as far as I can see. Also, all the existing tests in tests/gui pass after this change.
Looking through existing bug reports, I do not see any previous reference. The closest candidate is
QTBUG-37019, but there isn't a lot of information there and this seems to have a greater impact than that describes.
Hopefully this gives a good starting point from which to address this bug. In our application on Linux, we are doing many drag and drop operations, and some of them unexpectedly fail.