GtkPlug only works under X11 (JUCE 7.0.2, Ubuntu 22.04 LTS)

after upgrading Ubuntu to 22.04 LTS, my app closes on startup with this error :

GtkPlug only works under X11

This post suggests to set export GDK_BACKEND=x11 before running the app, but I can’t ask my users to do that.
Running the Projucer and various JUCE examples using OpenGL is just working fine, I checked if there are any special flags or settings but I couldn’t find anything that would differ from my project’s Projucer configuration…

Not sure what I’m missing here but if you got an idea, I’m all ears !
Thank you


Why it says GtkPlug? Maybe the JUCE_WEB_BROWSER=1 flag is set?
You can see what libraries your app is linked to:
ldd <yourapp>

JUCE_WEB_BROWSER is set to Default (Enabled), same as the examples

This might be the reason, does your app need the web client component? If no - try to disable it.

My app needs it yes, and I guess this should not be ok that this feature is not available anymore on Linux right ?
Also, I checked and the examples are having it enabled as well. They may not use it in the code though, but the macro is enabled

… but this was a GREAT advice though :wink:
Jus tried the WebbrowserDemo from the examples and I get the same error, so this is definitely a problem from there, and maybe there should be something to do on the JUCE side… .?

Thank you for the help !

Actually it should work. Am I getting right that it’s on Wayland?

What should work ?
Yes it is on Wayland o guess, but the weird thing is that setting GDK_BACKEND to Wayland didn’t make the program crash again, I can’t get it to a crashing state anymore…

What should work ?

apps compiled with JUCE_WEB_BROWSER=1 at least it works for me with X11

yes yes that we agree on :slight_smile:
Now the question is :
Ubuntu 22.04 now ships gnome by default and JUCE apps using WebBrowser are not working anymore.
What to do with that ?

Sadly, I haven’t idea, and I haven’t Wayland (mostly of such reason) to play with.
And I’m afraid it may be a huge PITA, when the user has Wayland and mixed Wayland/X11 DAW+plugins.

Just for curious, does any (demo) plugin (compiled without web part) works inside the Wayland session?

plugin I don’t know, I only have a Linux VM for testing my software (which is not an audio plugin) : Chataigne | Chataigne

You change the session to X11 xorg - How do I use X instead of wayland on 22.04? - Ask Ubuntu

Well again, I can’t ask users of my software to change their whole linux config just for running it…

1 Like

It seems that the question is does JUCE works with Wayland?

And the answer, I guess, is : Mainly yest, but not the Web browser part

1 Like

So it loads fine and welcome screen renders with GDK_BACKEND=Wayland?

Not sure, i’ll have to run more tests

Please could you test out the following patch, and check whether it prevents the crash in your application?

0001-WebBrowserComponent-Force-webkit2gtk-to-use-the-X11-.patch (4.4 KB)

It looks like this issue has been reported previously:

Thank you for this, what does it do exactly ?
I’ll try when I get more time for this, hopefully this week