I’m talking about a window which always stays on top of the main window but is otherwise not always on top (i.e. it can be covered by windows from other applications). A lot of applications have this kind of docks, Visual Studio is one example. I’m also quite sure applications do that on Mac OS X as well.
In Windows this is done by setting up your main window as the owner of your dock. You can’t set your window as always on top since then it covers windows from other applications as well. And if you don’t set up the owner of your dock, then it will be covered by your main window, and it’s almost impossible for users to bring it back to the top.
You can kind of emulate that in JUCE by doing something like this:
MyDockWindow::MyDockWindow(Component *ourMainWindow)
:
DocumentWindow("", some_color, DocumentWindow::allButtons, false)
{
// setup window
AppLookAndFeel::setUpNativeWindowStyle(*this, true);
// ... and so on
// Add window to desktop now
int flags = DocumentWindow::getDesktopWindowStyleFlags() &
(~ComponentPeer::windowAppearsOnTaskbar);
addToDesktop(flags, ourMainWindow->getPeer()->getNativeHandle());
}
But this messes up the internal bookkeeping of JUCE, it no longer knows which window is on top. So for instance drag operations to the docks won’t always work because JUCE thinks the main window is on top.
It is also possible to use setAlwaysOnTop(true) when the application gains focus, but setAlwaysOnTop(false) when losing focus doesn’t do the trick because at that point some other application window has focus and that window will not come on top of the docks anymore.
Is there any way to support this in JUCE?

