Linux X11 windowing in a VST 3.6.7 plugin using JUCE components


#1

Hi,
I’m making a VST3 plugin on Linux with the new release 3.6.7. I’m trying to make it work with the Steinberg “editorHost”.
For the GUI I’d like to use JUCE components instead of Steinberg’s VSTGUI. So I’ve defined a class “JUCEView” which inherits both from Steinberg’s EditorView and JUCE’s Component classes. To enable JUCE component attachment, I’ve overridden methods, especially the “attached” one :
> virtual Steinberg::tresult PLUGIN_API attached(void* parent, Steinberg::FIDString type) override;

In this method, after a setOpaque(true) and a setVisible(true) I call the JUCE Component’s “addToDesktop” :
> virtual void addToDesktop (int windowStyleFlags, void* nativeWindowToAttachTo = nullptr);

in order to create a new window which will be attached to the window host of the editorHost.

For windowing, JUCE opens a X11 connection (via a Display* structure) and configures it during the addToDesktop. The editorHost opens a connection too.
After initialization, there is an event loop of the editorHost. The plugin window is supposed to display on the host one.
However the loop crashes when the host tries to get properties from the plugin window in bool X11Window::Impl::handlePlugEvent (const XEvent& event) at line 766 of editorhost window.cpp : xembedInfo = getXEmbedInfo ();.
On console, I get the error "XGetWindowProperty for _XEMBED_INFO failed"
I guess the problem is that editorHost and the JUCE component target the same plugin Window but they don’t have the same Display connection. So the editorHost can’t access the window properties set in the addToDesktop of JUCE.

Is there a way (e.g. X11 function) to get this 2 connections working together ? Or to bring out the events from the JUCE display structure to the editorhost without disturbing the code of those ?

Thanks !
Adrien


VST3 build target just won't build
#2

Hi Adrien,

we are currently looking at supporting VST3 for linux. We’ve already finished hosting VST3s in JUCE but we are discussing some minor changes to the VST3 SDK for linux with Steinberg. I’d like to see how these discussions go before we publish anything.

The underlying problem is that the VST3 SDK expects that the plug-in only handles X11 events when it gets the IPlugViewIdleHandler::onPlugViewIdle callback from the host. This is something that JUCE does not currently support (it runs it’s on event loop on a separate thread). We also need to support XEmbed in the linux component peer code. We already support XEmbed when embedding plug-ins as a host but the other way around does not work yet.

Best,

Fabian


#3

Hi Fabian,
Thanks for the response. Looking forward to any news about it.
Best,
Adrien