Failure to launch; X11 and GLFW dependencies not in Flatpak
Hello,
New to Mosaic. I've installed via Flatpak. When I go to launch I get the following error:
[ error ] ofAppGLFWWindow: 65544: X11: The DISPLAY environment variable is missing
[ error ] ofAppGLFWWindow: couldn't init GLFW
[ error ] ofAppGLFWWindow: 65537: The GLFW library is not initialized
I assume this means Mosaic wants to use X11? I'm using Wayland.
I've installed xorgproto and glfw-dev from my distro's package manager but I get the same result.
$ uname -a
Linux unicron.rnkn.xyz 6.12.52-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2025-10-13 14:29:48 x86_64 Linux
Hi,
sorry but this is a Flatpak issue, probably related to your Rhino distro, i can't fix it from the Mosaic source code. The Flatpak install config includes either X11 than Wayland, so that should not be the problem.
Or maybe something related with XFCE, or the fact that Rhino uses Ubuntu devel branch ( you can experiment these kind of things when using the devel branh )
I'll let you know if i find more info about the issue, but i can't solve it from here.
Maybe updating the flatpak install will fix the issue, i'll let you know when it's updated.
Thanks for the quick reply! I'm actually on Alpine Linux using GNOME. As I understand it, Alpine currently uses Linux 6.12.52 LTS.
The main difference between Alpine and other distros is the use of the musl C library and that it doesn't use systemd, but I don't think this would affect Flatpaks.
I think OpenFrameworks doesn't support Wayland yet.
A PR is on it's way here : https://github.com/openframeworks/openFrameworks/pull/8255
I tested wayland and it's as @Daandelange says, it's a current OF limitation, Mosaic flatpak manifest let the option open ( uses wayland or x11 as fallback ) but glfw implementation inside OF need to be fixed for wayland. So the only option right now is to install x11 in alpine and open the user session with it, so it's just install x11 server and configuring it to work with Gnome.
Let me know how it goes!
P.S. I'm trying to update glfw to the last release in flatpak manifest, i'll check it to see if helps some
Ok, just tested it, definitely something happens with an OF glfw based app compiling via flatpak running on Wayland, i'm on Wayland now and Mosaic from flatpak still give error even switching to the last glfw release ( 3.4 )
But local compilation of Mosaic works just fine in Wayland as in X11, so another option is to check the Mosaic installer:
https://github.com/d3cod3/Mosaic-Installer/
the only perk ( not a small one ) is that right now the installer is automated for some linux flavours but not yet for Alpine Linux, maybe you can help us with that? How you do with bash scripting?
Just found this:
https://github.com/flatpak/flatpak/issues/5996
I found a workaround. If I install Flatseal and remove Mosaic's permissions for Wayland and the fallback to X11, and just keep X11 then it launches without issue.
Re the install script, I'm not a big fan of install scripts tbh. I prefer Makefiles. I'll circle back once I dive into Mosaic some.
Ok, this is a good piece of information, i'll try modifying the manifest to have it configured this way, maybe it will solve the issue ( this is forcing to launch xwayland so it runs fine). I understand the problem with install scripts, first of all in terms of security, but OF don't works with cmake ( yet ) and Mosaic still is a code tetris of various flavours, so for now, the install script is the way.
If you check the install script, anyway, you'll see that everything is standard apt/pacman/dnf installs, cloning from github and just downloading one file from my webpage with a patched version of openframeworks for compiling without issues, everything is exposed for audit.
Happy to see that you circumvent the problem, just update to the last release 0.7.3, if you haven't yet, to have the last code available.
Well, in my laptop, PopOS 22.04 with Wayland and Flatseal configured to X11, still do not work! couldn't init GLFW error still there...