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.25k stars 392 forks source link

Lots of lagging when using touch drag and drop. #448

Closed las-nsc closed 1 year ago

las-nsc commented 2 years ago

Describe the bug We have implemented drag and drop using this library and tested it with mouse without any significant issues (except this), but when it was deployed to the target hardware which uses touch, there was semi-random and significant lagging issues where it could take minutes to drag something across the screen.

To Reproduce Unfortunately I can't share our code to demonstrate the issue, but I have tried to diagnose the issue myself by using the source for this library. Running performance diagnostics shows the majority of time spent on the System.Windows.DragDrop.DoDragDrop method, which seems to block the UI thread due to its synchronous nature and can't be offloaded to another thread due to needing access to the dragged item template. One thing I did try is to add CacheMode = new BitmapCache(); to the DragDropPreview which might have improved things a little, but I am still seeing noticable lagging occasionally.

Expected behavior No significant lagging with touch, same as mouse.

Screenshots It would have to be a video, but not sure if I can share. TBD

Desktop (please complete the following information):

I'm not sure why the issue is only noticable when using touch and not mouse, and it doesn't seem to be directly caused by anything this library is doing itself (particularly as the touch code doesn't seem to do anything much different to mouse), but is core to how the library works. Has anyone seen this sort of issue before and have a workaround?

las-nsc commented 2 years ago

Having looked closer at other issues, I believe this is a duplicate of #418, being fixed by #444

dxh-sc commented 2 years ago

I have same issue

punker76 commented 1 year ago

Duplicate of #418