Hello. I'm having a bit of trouble implementing an external drag and drop. I've called the function in MouseDrag(), but it's not working as expected. The little hand symbol comes up, and the following call produces true for the first pixel of drag movement, then false for the rest. Am I going about it all wrong, or is it an issue with me using Linux (I don't have a Windows machine to test on at the minute)? My Component inherits DragAndDropContainer.
Sorry Jules, couldn't see it anywhere in the comments or docs.
I really don't understand the drag and drop at all...
I've changed it from mouseDrag to mouseDown so it only calls once.
shouldDropFilesWhenDraggedExternally() is being called when I drag out of the JUCE window, but nothing is actually dragged - no icon change etc. I've tried passing the file I want to drag and drop in multiple different places, but non seem to work.
Ah, well maybe it's a linux thing - I've not really tested it in earnest on there. TBH I never call it directly, I generally use the flag in DragAndDropContainer::startDragging that automatically does a drag to external windows. Have you tried the drag + drop page of the juce demo in your OS?
Cheers Jules. Yeah I've tried the drag and drop in the demo, it doesn't do an external drop, and I've tried every possibility in my own code. It's probably a linux thing - I'm using Lubuntu, with loads of random packages. Something is probably conflicting. I'll try the same thing on Windows as soon as I get my Windows machine back up and running.
Hi,
nearly 10 years later… I am able to drag drop from app → desktop on my mac, but not on linux. Is this implemented on linux? If not are there any plans to do so?
Ah sorry, I was using wayland and not X11. Now after becoming aware of it and changing my ubuntu to X11 things are working again…
Problem is also mentioned here: Drag'n drop on wayland (but the other way around, so from e.g. nautilus → juce-app)
Also a good time for me to give a vote for Wayland support
I’m having a hell of a time getting external drag and drop to work on a Mac. I’m just wondering - the code you posted above - is this what you got working? I’ve tried every variation I can come up with and no matter what, the performExternalDragDropOfFiles function immediately returns false as soon as it’s called. Thank you in advance if you have any pointers!