In a wayland environment, by default firefox will run as an X
application using Xwayland. This can be changed with 'export
MOZ_ENABLE_WAYLAND=1' before calling firefox-esr, but that isn't
integrated into a desktop environment. It would be good to get it
integrated.
One possible way to do this is based on what Fedora does: create
a firefox-wayland package that depends on firefox-esr, and just
contains the script /usr/bin/firefox-wayland with:
#!/usr/bin/bash
#
# Run Firefox under Wayland
#
export MOZ_ENABLE_WAYLAND=1
exec /usr/bin/firefox "$@"
I'm actually not a fan of this, as there's already enough permutations
of firefox binaries and packages between firefox and firefox-esr, and
adding more with firefox-*wayland would get annoying.
Another option (and the one that I think I'd prefer) is to just include
firefox-wayland.desktop and firefox-esr-wayland.desktop files in the
firefox and firefox-esr packages. That would just set the variable and
then run whatever version of firefox the package has installed.
A 3rd option is to set the variable through systemd, apparently:
https://wiki.archlinux.org/index.php/Environment_variables#Graphical_environment
I haven't tried it, and I don't think I'd want the user forced to fight
environment variables if they want to go back to firefox using X, so
I'm not a fan of that method.