Transparent Window & Plugins


#1

When I make a DocumentWindow transparent 'setOpaque(false)' and then load in a VST plugin, the plugin does not show, only the title bar shows. I am doing this so I can have a window with rounded corners for showing plugins.

Any advice?


#2

The way that win32 does transparency is a total bodge, and transparent windows don't behave like normal ones - they can't contain child windows. So you can't use them for holding plugins.

The best you could do is to float a transparent title bar next to a normal plugin window and move them around together.


#3

Ok, you convinced me not to mess with the transparent window for now, but how do you make a window float above the main window, but disappear when another app is made active? In other words, behave like the main app window.


#4

You can check Process::isForegroundProcess to see whether you're in front, or react to focus gain/loss events on your windows.


#5

Well gain/loss events on your windows would be nice but it doesn't work. If you have you app open and click any other app to open it, gain/loss events to the main window do not get called. Am I missing something?


#6

You can't always get a reliable event to tell you that the front process has changed - in my code I ended up having a timer to poll it occasionally.


#7

This has been requested by many people. Host plugins need to be above the main window but not above the other apps. I am looking into the WM_ACTIVATEAPP in windows, about to hack the juce code. If this mesasage were directed to the main window, it could hide/show all of the setAlwaysOnTop windows. Am I correct?


#8

I found a simple solution.

In the main window override:

void globalFocusChanged (Component *focusedComponent)
{
     static bool bInFront = true;

     if (Process::isForegroundProcess() != bInFront)
     {
         bInFront = Process::isForegroundProcess();
         pAudioEngine->ShowHideAllWindows (bInFront);
         if (bInFront)
             toFront (true);
     }
}

You could add a window type floating ( for plugins, toolbars,  etc. ) and have have the desktop hide/show them on this call.