I’m attempting to show a webview in a Linux application using XEmbedComponent and the choc webview. I’ve gleaned its usage from the docs, a sample plugin, and Jules’ cmajor implementation that he’s referenced in the forum. These use different ways to embed the choc webview into the XEmbedComponent (the plugin uses getViewHandle() as the window id, while the cmajor code uses gtk_plug_get_id()), but both methods have the same result - a window with black content. The corresponding method on Mac OS using NSViewComponent works great, but only shows black on Linux (Ubuntu 22.04). The code essentially comes down to (within the parent Component constructor):
choc::ui::WebView::Options options;
options.enableDebugMode = true;
fChocWebView = std::make_unique<choc::ui::WebView>(options);
#if JUCE_MAC
fEmbedView = std::make_unique<juce::NSViewComponent>();
fEmbedView->setView(fChocWebView->getViewHandle());
#elif JUCE_LINUX
//fEmbedView = std::make_unique<juce::XEmbedComponent>(getWindowID(*fChocWebView), true, false);
fEmbedView = std::make_unique<juce::XEmbedComponent>(fChocWebView->getViewHandle());
#endif
addAndMakeVisible(fEmbedView.get());
fChocWebView->navigate("https://somewebsite.com/");
Any insight would be appreciated.
