Can't drag and drop file from plugin in Studio One version 2


#1

Not sure if anyone else has come across this but it seems to not be possible to drag and drop files from a plugin window in Studio One version 2.6 on OS X. It works fine in S1 on Windows. Also works fine in Studio One version 3 on OS X.

I am also able to drag and drop from a standalone application using the same method (below), just not from a plugin.

Does anyone know why this might be? Is there anything that can be done on the plugin side or is this S1 blocking the plugin somehow?

Minimal sketch code to reproduce:

class Draggable :
public Component
{
public:
    Draggable()
    {
        rect.setFill(FillType(Colours::red));
        addAndMakeVisible(rect);
    }
    
private:
    
    void resized() override
    {
        rect.setRectangle(getLocalBounds().toFloat());
    }
    
    void mouseDrag (const MouseEvent& e) override
    {
        if (DragAndDropContainer* const dragContainer = DragAndDropContainer::findParentDragContainerFor (this))
        {
            int x = 0;
            int y = 0;
            Image dragImage = createComponentSnapshot(getBounds());
            
            MouseEvent e2 (e.getEventRelativeTo (this));
            const Point<int> p (x - e2.x, y - e2.y);
            dragContainer->startDragging ("/Users/jamie/foo.wav", this, dragImage, true, &p);
        }
    }
    
    DrawableRectangle rect;
};

class TestDragAndDropPluginAudioProcessorEditor  : public AudioProcessorEditor, public DragAndDropContainer
{
public:
    bool shouldDropFilesWhenDraggedExternally(const DragAndDropTarget::SourceDetails& sourceDetails, StringArray& files, bool& canMoveFiles) override
    {
        files.add( "/Users/jamie/foo.wav");
        return true;
    }

private:
    Draggable draggable;

};