Switch to External Drag And Drop issue on Mac + suggested fix

Our testers hit an issue when dragging from a JUCE app to another app on the Mac and think I’ve found a solution as per the change to juce_DragAndDropContainer.cpp below.

Can anyone spot any unwanted side effects from this change?

The specific case is when the user uses cmd+tab to switch to another app that then renders on top of the JUCE application. (e.g. cmd+tab to a Finder window which now appears above our app), and the app does not switch to an external drag and drop.

Note that we are using DragAndDropContainer::shouldDropFilesWhenDraggedExternally() to switch from an internal drag to an external drag, however this does not get called.

Triggering the checkForExternalDrag when Process::isForegroundProcess () is false as per the change below appears to address this.

Thanks for any insights!
Dave