Erratic incomming DnD behavior

Hi Jules,

Since I’ve updated to the tip some time ago, I’m seeing weird behavior with DnD not always detected.
Depending on how fast I enter the DnD in my Window, it is either seen or not.

When it doesn’t work the first handleFileDragMove (from a JuceDropTarget::DragEnter) do not find any component as the x is equal -2 after that I never received any JuceDropTarget::DragOver.

You can easily reproduce it using Juce Demo and the code editor demo trying to DnD a file on the combo like file selector


Happen on Window 7 as well. Edited post title

If the only x coord that windows sends is -2, then doesn’t it seem reasonable that it wouldn’t find a target…?

I agree but it do not receive any new callback after that and it use to work in previous build.

Just try to the juce demo and the code editor demo trying to DnD a file on the combo like file selector

Incoming DnD on Windows is quite broken right now

By the way, it works like one time on six so please try another time if this works for you directly.


Ah, I see. It seems that in the JuceDropTarget::DragEnter class, it should always return S_OK, otherwise Windows gives up and doesn’t bother asking again. Thanks!

That did the trick.
You indeed need to returns S_OK to all the function of IDropTarget


No - AFAICT only DragEnter() needs to do that. The others can return S_FALSE if the drag event isn’t wanted.

You’re sure ?

Well… it does work correctly even when it returns S_FALSE, but I guess that according to the docs you’re right, it should be S_OK.