Skip to content

Fix DnD started in the border

If an user tries to start a Drag&Drop operation near the border of an icon, and moves the cursor outside it, the operation won't start because the mouse cursor must move, at least, DRAG_TRESHOLD pixels to start it, but if there aren't enough pixels between the starting coordinates and the exit point, the DnD operation won't start, but the icon will be kept in "waiting mode". The result is that the user will see that the icon won't start moving, so (s)he will release the mouse button (which will happen outside the icon container, so it won't be detected by the fileItem object), and will move the mouse cursor inside the icon to try again. At this moment, since the fileItem is still in the "waiting mode", it will receive the motion events and, since now the user will do the operation more carefully, it is sure that the mouse will move more than DRAG_TRESHOLD pixels inside the container. This will be detected by the fileItem object and the DnD operation will start. This behavior is anoying for the user.

This patch fixes this by aborting the operation of deciding wether to start or not a DnD if the mouse cursor leaves the icon before having traveled DRAG_THRESOLD pixels. Thus the user will see that (s)he missed the icon and will retry, but this time without anoying effects.

Edited by Rastersoft

Merge request reports