Neil Hodgson - 2016-01-18

It'd be better to trace this down further as failing a drag action isn't great for the user. Its not an issue with the selection being empty since that is blocked at the top of StartDrag. The zero size is a bit similar to earlier Cocoa issue(s) when the view was being destructed.

Some of the state modified before the selectionRectangle assignment may need to be reverted, or moved after the check. This includes inDragDrop, the drag pasteboard, and the ticker (may terminate safely after one tick but should be checked).

StartDrag is too complex and could benefit from some breaking up with a pure calculation (side effect free) section followed by changes to global state. A zero size could indicate an unforeseen case in the rcSel calculation and this code would be simpler to analyze if it was moved into its own method.

Could this be a scrolling case where the selection has moved off-screen before the drag starts?

 

Last edit: Neil Hodgson 2016-01-18