Drop and drop from finder / desktop

I have a window which accepts drag and drop, however if I drag a file from finder to the xojo window, it only works if the xojo window has focus on the OSX desktop (eg it has the highlighted shadow as the active app on the desktop)
However when I drag a file from the desktop into XOJO, 99% of the time it snaps back to the desktop and the drop event is not fired, this seems to be when the XOJO app has lost OSX desktop focus.
If I am lucky enough to drag a file to the XOJO app (while it still has focus) it detects it.

Anyone any ideas?


try this… it may or may not work.

In the MOUSEENTER event for the window… put “me.show”

How much code is in the DropObject event? I’ve discovered that the answer is to have very limited code in the actual DropObject event and then fire a one-shot timer to actually perform the functionality that you need in processing the drop.

When I had long methods in the DropObject event, it would appear that the app didn’t accept the drop, hung, and sometimes even crashed. By moving the main code into the Action event of a timer and then firing that from the DropObject event, these issues went away.