- hdl->dragging = 0;
- if (dest >= 0) {
- /* Correct for "missing" item. This means you can't drag
- * an item to the end, but that seems to be the way this
- * control is used. */
- if (dest > hdl->srcitem) dest--;
- pl_moveitem(hwnd, hdl->listid, hdl->srcitem, dest);
+ if (hdl->dragging) {
+ hdl->dragging = 0;
+ if (dest >= 0) {
+ /* Correct for "missing" item. */
+ if (dest > hdl->srcitem) dest--;
+ pl_moveitem(hwnd, hdl->listid, hdl->srcitem, dest);
+ }