Hi
I noticed, that RTAS wrapper on OSX is missing the part of the code that intercepts hide/show window events, so when you hide ProTools window (I mean “hide” not minimize), the juce plugin window will stay on desktop.
The missing parts seem to be (in juce_RTAS_MacUtilities.mm) :
attachSubWindow()
const EventTypeSpec eventsToCatch[] = {
{ kEventClassWindow, kEventWindowShown },
{ kEventClassWindow, kEventWindowHidden }
};
EventHandlerRef ref;
InstallWindowEventHandler ((WindowRef) hostWindowRef,
NewEventHandlerUPP (windowVisibilityBodge),
GetEventTypeCount (eventsToCatch), eventsToCatch,
(void*) hostWindow, &ref);
comp->getProperties().set ("carbonEventRef", String::toHexString ((pointer_sized_int) (void*) ref));
removeSubWindow()
EventHandlerRef ref = (EventHandlerRef) (void*) (pointer_sized_int)
ref = (EventHandlerRef) (void*) (pointer_sized_int) comp->getProperties() ["carbonEventRef"].toString().getHexValue64();
RemoveEventHandler (ref);
and additional windowVisibilityBodge() function
static pascal OSStatus windowVisibilityBodge (EventHandlerCallRef, EventRef e, void* user)
{
NSWindow* hostWindow = (NSWindow*) user;
switch (GetEventKind (e))
{
case kEventWindowShown:
[hostWindow orderFront: nil];
break;
case kEventWindowHidden:
[hostWindow orderOut: nil];
break;
}
return eventNotHandledErr;
}
cheers,
Bart