Today I finally managed to compile and run a Firefox version, which was patched to work on Wayland natively. To achieve this, I used the forked and enhanced Firefox version of the Red Hat developer Martin Stransky.

For all those who are unaware of the Wayland project, it’s an succesor to the very old, but still common X display server for Linux operating systems. Compared to X, Wayland is a lot smaller in its code base, written from scratch, far more secure and build up on the newest 3D graphic driver stack. Unfortunately not all big Linux applications support it yet. The work on Wayland compatibility for Firefox was already requested some years ago and it was not moving forward very fast. Fortunately, some days ago it looks like the first patches have been merged into master.

Firefox running natively on Wayland using ArchLinux x64

So again, I gave it a try and this time my buildscript, which I submitted to the AUR compiled fine and I also was able to run Firefox without using xwayland :) So here are the few steps to get it working (in this case I’m using pacaur as an AUR helper script):

pacaur -S firefox-wayland-git
GDK_BACKEND=wayland firefox

As expected it is not stable nor usable yet but at least it is a proof that the Firefox developers getting closer to solving this issue and are still working on it!

Even easier: Test it with precompiled and sanboxed Flatpak-Repo

Further, I was testing out Flatpak, a project of the Gnome Foundation, which is a kind of cross-Linux package manager for precompiled packages and also provides a very useful sandboxing approach.

So why not build a Firefox Flatpak with Wayland patches so it is even easier for others to try out on all the operating systems without having to always recompile it (which would take many hours and consume a lot of memory …). First I forked a custom Firefox Flatpak repository on Github from the user kinvolk (thanks!) and customized it to compile Martin Stranskys repository with Wayland patches. I had to be sure that the systems Wayland socket is accessible inside the sandbox, which was already the case.

Well, and that’s how you can test the Flatpak (assumed you have a Flatpak client already installed):

flatpak --user remote-add --no-gpg-verify firefox-wayland-git https://onny.project-insanity.org/files/firefox-wayland-git/repo
flatpak --user install firefox-wayland-git org.mozilla.firefox
flatpak --env GDK_BACKEND=wayland run org.mozilla.firefox

That’s it, Firefox should start on your Wayland desktop! Please note that this might run even slower here, especially because it was build in debug mode.

Update 01.2018: This article was featured on the popular US open source news site Phoronix in February 2017.