I needed this myself, so here’s a little helper…
Typically when you use setAlwaysOnTop on mac in a Juce App, it floats it above all windows in the system… Got some complaints about that(user’s wanted the window to disappear when the app doesn’t have focus)…
#if JUCE_MAC
MacHelpers::makeWindowFloatingPanel(this);
#else
MacHelpers is the namespace…
and then in a .mm file
void MacHelpers::makeWindowFloatingPanel(Component *aComponent)
{
jassert(aComponent);
ComponentPeer *componentPeer=aComponent->getPeer();
jassert(componentPeer);
componentPeer->setAlwaysOnTop(true);
NSView* const peer = (NSView*) (componentPeer->getNativeHandle());
jassert(peer);
NSWindow *window=[peer window];
jassert(window);
[window setHidesOnDeactivate:YES];
}