#1534 Drag and drop between ScintillaView's doesn't work

Bug
closed-fixed
Neil Hodgson
5
2014-06-15
2013-10-03
chinhster
No

If you drag some text from one ScintillaView and drop to a different ScintillaView in the same application, no text is inserted into the destination ScintillaView.

I was able to fix this by changing in ScintillaCocoa.mm ScintillaCocoa::PerformDragOperation():

  bool moving = (operation & NSDragOperationMove) != 0;

to

  InnerView* contentView = ContentView();
  bool moving = ((operation & NSDragOperationMove) != 0) && (contentView == [info draggingSource]);

However, this doesn't account for two different ScintillaView's that point to the same document (for example, from a split view).

Discussion

  • Neil Hodgson
    Neil Hodgson
    2013-10-04

    Dragging between SciTE's edit and output pane works. It doesn't work with an empty destination view but that's because of code to avoid moves to the same location.

     
  • chinhster
    chinhster
    2013-10-04

    My destination view is typically empty because it's a command line view and the source view is typically an editor view.

     
  • Neil Hodgson
    Neil Hodgson
    2013-10-04

    The problem may be that inDragDrop is being set when its a drag target, not a drag source. Try the attached patch.

     
    Attachments
  • chinhster
    chinhster
    2013-10-04

    That fixed it, thanks.

     
  • Neil Hodgson
    Neil Hodgson
    2013-10-04

    • labels: drag and drop --> drag and drop, scintilla, cocoa
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson
    Neil Hodgson
    2013-10-04

    Committed as [483668].

     

    Related

    Commit: [483668]

  • Neil Hodgson
    Neil Hodgson
    2013-10-15

    • status: open-fixed --> closed-fixed