Version 100.0b9-1 (currently on --beta) of the Firefox snap supports running on Wayland “out of the box”, and works well with Mir based servers. No need to configure the Firefox environment environment variables or current profile.
[Original post]
Firefox will work “out of the box” on Mir servers that are configured to support X11 applications. But Firefox has support for Wayland and it would be good to enable this.
There are a couple of things that need doing for Firefox to use Wayland on Mir servers:
It needs MOZ_ENABLE_WAYLAND set in the Firefox environment.
Secondly, it needs gfx.webrender.all set to true in the user options of the current profile.
While the latter can be set in the Firefox GUI I found it convenient to write a script that patches all profiles:
$ cat `which fix-firefox-wayland.sh`
#!/bin/sh
if [ -f prefs.js ]; then
echo Checking profile \'$(pwd)\'
if [ ! -f user.js ] || ! grep -q "gfx.webrender.all" user.js; then
echo Fixing user.js for profile \'$(pwd)\'
echo 'user_pref("gfx.webrender.all", true);' >> user.js
fi
else
find ~/.mozilla/firefox/ -name prefs.js -execdir $0 \;
fi
After compiling the snap and running it. I get this in the terminal. The firefox actually starts in a new window not in the mir-kiosk window.
ake@jake-Parallels-Virtual-Platform:~$ snap run mir-firefox
(firefox:21789): Gtk-WARNING **: 21:04:52.733: Locale not supported by C library.
Using the fallback 'C' locale.
(firefox:21789): GdkPixbuf-WARNING **: 21:04:52.909: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
Gtk-Message: 21:04:52.950: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:04:52.955: Failed to load module "canberra-gtk-module"
~
This file exists in /var/lib/snapd/hostfs/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0
I tried to add the path to the snap. I get this error during compiling. I don’t have idea what to do. Can you help?
I understand the error means the /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache does not exist. I can make a new loaders.cache by running gdk-pixbuf-query-loaders
mir-firefox:
command: "/snap/firefox/current/firefox"
environment:
RESOURCES_PATH: $SNAP
plugs:
- home
- desktop
- opengl
- wayland
parts:
firefox:
plugin: nil
stage-packages:
- firefox
override-build: |
# this will not work since $SNAP is read only file system
/root/parts/firefox/install/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders > $SNAP/loaders.cache
layout:
/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0:
bind: $SNAP
@zhex900 you need to figure out how to get firefox to connect to the Wayland socket provided by mir-kiosk. From your description any of the following could be happening:
firefox isn’t starting
firefox is starting, connecting to the X11 socket provided by your desktop environment and appearing on your desktop
firefox is starting, connecting to the Wayland socket provided by your desktop environment (if any) and appearing on your desktop
You have to figure out which of these is happening and what to do about it.
In all these possibilities your problems are related to the snap you are building, and not to Mir. If that’s the case, they are better discussed as a new “Problems snapping firefox” thread on the snapcraft forum. Not here.