So far I’ve come up with this:
The native handle returned by JUCE is a NSView* . From the NSView, I get the reference to the NSWindow (= DocumentWindow with native title bar). Then I traverse the child windows recursively (always only taking first one) until I reach the last child, which is the plugin editor’s view, and I use that windowID.
There seems to be a problem though, and I assume it’s a JUCE bug: The first time this all works, but after removing the plugin from the DocumentWindow and adding it as child to another component, then putting it back into the DocumentWindow, there’s a problem. In fact after doing so, the number of child windows reported by the NSWindow is not 1 anymore, but 2, which is wrong. It seems that the JUCE code forgets to remove the NSWindow children?