punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF
BSD 3-Clause "New" or "Revised" License
2.31k stars 405 forks source link

Quick click leaves drag template ghost that won't disappear #503

Open robbiehinch opened 5 days ago

robbiehinch commented 5 days ago

Added mouse button down guard around DragEnter

Please check the logging (now removed) added in commit 80d9ac5633fc06dcf7f2e4f85e10b1342085df70

Doing a fast click, drag, release can make the drag template stay open indefinitely. It's because the DragEnter event handler can be called after the DragSourceOnQueryContinueDragevent, but there are no mouse buttons depressed when it is called:

DragSourceOnMouseMove Left Pressed
_draginProgress true
DoDragSourceMove setting preview
UpdatePreviewPresenter ->
setting template
DragSourceOnQueryContinueDrag setting nulls
DropTargetOnDragEnter Copy, Move None
DragEnter
DropTargetOnDragOver setting preview
UpdatePreviewPresenter ->
setting template
UpdatePreviewPresenter ->
visual source not null
Drag cancelled
DragDropOperationFinished None
_draginProgress false
DragLeave