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

**URL:** <https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142>\
**Category:** General JUCE discussion\
**Created:** [September 25, 2022, 10:11am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142 "2022-09-25T10:11:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [September 25, 2022, 10:11am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/1 "2022-09-25T10:11:28Z")

</div>

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

```auto
GtkPlug only works under X11

```

[This post](https://forum.juce.com/t/list-of-juce-dependencies-under-linux/15121/40) 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

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [September 25, 2022, 2:38pm UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/2 "2022-09-25T14:38:52Z")

</div>

Hi,

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>`

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [September 25, 2022, 6:07pm UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/3 "2022-09-25T18:07:42Z")

</div>

JUCE\_WEB\_BROWSER is set to Default (Enabled), same as the examples

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [September 27, 2022, 3:58am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/4 "2022-09-27T03:58:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [September 27, 2022, 9:04am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/5 "2022-09-27T09:04:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [September 27, 2022, 9:08am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/6 "2022-09-27T09:08:44Z")

</div>

… but this was a GREAT advice though 😉  
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 !

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [October 2, 2022, 11:02pm UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/7 "2022-10-02T23:02:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 8:13am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/8 "2022-10-03T08:13:00Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [October 3, 2022, 8:30am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/9 "2022-10-03T08:30:07Z")

</div>

> What should work ?

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

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 8:49am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/10 "2022-10-03T08:49:49Z")

</div>

yes yes that we agree on 🙂  
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 ?

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [October 3, 2022, 9:07am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/11 "2022-10-03T09:07:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 9:19am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/12 "2022-10-03T09:19:57Z")

</div>

plugin I don’t know, I only have a Linux VM for testing my software (which is not an audio plugin) : [Chataigne | Chataigne](https://benjamin.kuperberg.fr/chataigne)

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [October 3, 2022, 9:39am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/13 "2022-10-03T09:39:13Z")

</div>

You change the session to X11 [xorg - How do I use X instead of wayland on 22.04? - Ask Ubuntu](https://askubuntu.com/questions/1410256/how-do-i-use-x-instead-of-wayland-on-22-04)

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 9:50am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/14 "2022-10-03T09:50:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nicolasdanet](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/nicolasdanet/32/56_2.png) [@nicolasdanet](https://forum.juce.com/u/nicolasdanet)\
**Post date:** [October 3, 2022, 10:39am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/15 "2022-10-03T10:39:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 10:55am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/16 "2022-10-03T10:55:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KottVV](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kottvv/32/14169_2.png) [@KottVV](https://forum.juce.com/u/KottVV)\
**Post date:** [October 3, 2022, 11:05am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/17 "2022-10-03T11:05:46Z")

</div>

> [@benkuper](#):
>
> 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…

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

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 11:41am UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/18 "2022-10-03T11:41:10Z")

</div>

Not sure, i’ll have to run more tests

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [October 3, 2022, 2:30pm UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/19 "2022-10-03T14:30:53Z")

</div>

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](https://forum.juce.com/uploads/short-url/bORnrG3gg3M4gu6rIYS0ncgotoU.patch) (4.4 KB)

It looks like this issue has been reported previously:

> [@List of Juce dependencies under linux](https://forum.juce.com/t/list-of-juce-dependencies-under-linux/15121/41):
>
> You need to set the backend to X11 instead of Wayland which is now the default, you can do this by typing export GDK\_BACKEND=x11 or just GDK\_BACKEND=x11 Projucer.

---

<div class="post-metadata">

**Author:** ![benkuper](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/benkuper/32/899_2.png) [@benkuper](https://forum.juce.com/u/benkuper)\
**Post date:** [October 3, 2022, 5:06pm UTC](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142/20 "2022-10-03T17:06:23Z")

</div>

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

[Next page](https://forum.juce.com/t/gtkplug-only-works-under-x11-juce-7-0-2-ubuntu-22-04-lts/53142.md?page=2)
