Hello,
in a JUCE plugin i have a secondary juce::DocumentWindow
. Is there a way that this window stay on the top?
My problem is when i use it with the DAW Linux Ardour, if i clic on Ardour main window, then Ardour window goes on the front of it, so my DocumentWindow disappears on the back of it (the main plugin window stays in front).
This problem does not occur with MacOS Ardour or LogicPro.
May be is it a problem with Ardour on Linux?
Thanks,
Frédéric.
Good evening,
Is the DocumentWindow detached from the plugin window?
If I’m correct there should be an option on DAWs that keeps plugins to the front, like an “Always on top” option.
Anyways, DocumentWindow inherits from Component, which has a toFront() method, but also a setAlwaysOnTop(bool) method! Try setting that to true at the end of the constructor.
Keep us updated!
Giacomo
In general, having secondary windows detached from the main plug-in UI causes this kind of issues sooner or later, it depends on several factors (OS, DAW, etc.) and, unless you test on all those combinations, you can never be sure it works the intended way. And even then, an update may come out that breaks something, and you have to start over.
If your plug-in UI is big enough, you can add the DocumentWindow as a child of it. If you want it not to overlap with the main UI of your plug-in, I suggest you implement it as an additional column/drawer that extends the plug-in UI to show the additional controls. The plug-in can resize itself to whatever new size it wants (apart from AUv3 format, but that doesn’t seem to be your case)
It’s working just as I wanted! Thank you very much!
This seems interesting, but i don’t imagine exactly what it means. Is there an example or a demo of this?
You can have a look at BREVERB 2, it does what I mean with the drawer at the bottom, that contains 6 faders. There is an arrow that you can click to collapse/expand that part of the plug-in.
In JUCE, the plug-in developer controls the size of the UI by calling setSize() on the main editor component. You can do so for example on the click of a button like in the case of BREVERB 2, toggling between two sizes. Obviously, when you change the size of the plug-in, you should also update the UI by adding/removing/rearranging the Components as you see fit.
Thanks. I’ve heard that the best practice is to integrate the drawings in a single window of the plugin and not have several windows. I’ll try to follow this solution.