-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firefox, thunderbird, librewolf: Enable wayland support by default #201359
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/firefox-all-black-when-first-launched-after-login/21143/15 |
So using Does anyone know why firefox doesn't enable this by default itself? I've run with MOZ_ENABLE_WAYLAND=1 for a while on Wayland, and it does fix the occasionally black screen / crash on startup, so +1 from me. |
Some bugs supposedly: |
d188262
to
9ccabc8
Compare
Funnily, there are both kinds in there – bugs in running on Xwayland ("Blocks") and bugs in running on Wayland ("Depends on"). |
9ccabc8
to
1f4e696
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the one hand, firefox-wayland
is superior to the experience on xwayland and I've been using it because of that but OTOH Mozilla explicitly decided against enabling wayland by default and it's kind of their decision whether they deem their wayland support to be production-ready.
What Fedora did here was to enable wayland by default in firefox
but offer a firefox-x11
. I think we should do the same.
Ah, right, this might have licensing implications since we'd be distributing a branded non-standard build. Sigh. |
All this does is set an environment variable in the wrapper script we use to invoke Firefox; does that really constitute changing the build for purposes of licensing? |
I don't think this affects licensing unless we severely degrade the UX. |
Well, the thing is, we could severely degrade UX by enabling wayland. You and I are comfortable with that but some of our users wouldn't even know that the terrible bug they just experienced could have been caused by wayland being enabled or that that's even the case. I don't think Mozilla will be coming after us in any capacity if we did a minor thing like this (even if they'd rather we didn't) but, as a packager, it's a general courtesy to follow upstream projects explicit UX decisions wherever possible. Fedora stoke a nice balance I think but, from Mozilla's perspective, they'd probably rather have us keep it the way it was (convenient yet explicit wayland opt-in). |
I was baffled to find out that I'd been using Firefox with XWayland all the time. As of 2022, I'd expect applications to use Wayland by default if they support it. Since this is just an environment variable and not a compile flag, and that setting it does not affect X11 support, I am not concerned about licensing stuff. However, I think we should still provide a way to opt-out of Wayland, i.e. to force the usage of XWayland if desired. Since we are setting the environment variable in the wrapper, setting An alternative would be to set this environment variable globally, for example as part of a |
A nixpkgs config option would work, and apply to non-NixOS systems. |
if we use |
Then that should be taken up with Mozilla.
The method does not really matter. And since Mozilla only allows us to use the Firefox trademark as long as our changes do not break their product, it is our responsibility to make sure that any changes are in fact non-breaking, if we want to keep using the Firefox branding. At minimum, we should probably find out why exactly it is not enabled by default. But final decision whether the change would be fine with Mozilla can only be done by Nixpkgs Firefox maintainers, hoping that their mental model of Mozilla is good enough. |
1f4e696
to
35ac310
Compare
35ac310
to
02bdd15
Compare
02bdd15
to
4c5d7c1
Compare
This comment was marked as resolved.
This comment was marked as resolved.
(fwiw, I generally agree with @jtojnar) |
The basic change here is that nobody will use XWayland by default anymore. Nobody will be able to pick the wrong firefox package anymore. XWayland is most certainly the variant that gets the least maintenance at this point. Accessibility features like the onscreen keyboard don't seem to work under XWayland. I think keeping a We're not the first distro to enable Wayland by default, Ubuntu went first. I do not expect any licensing issue with this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this PR is good as it is now. The variable is there.
I've also been using this PR on pure X11 since the moment it was open. The wayland variant has been heavily tested by other nixers for a long time, so it's not anything new.
The variable override sounds sufficient at this point, as so far there's no evidence that it would be commonly needed and it works across all the packages using the wrapper.
Enabling Wayland support by default prevents use of XWayland on Wayland systems, while correctly falling back to X11 when Wayland is unavailable in the current session. With the current packaging many people unnecessarily rely on the `firefox` attribute, which is suggested by nixos-generate-config, which in turn makes their Firefox use XWayland, when it shouldn't, which causes bugs with GNOME on Wayland: https://discourse.nixos.org/t/firefox-all-black-when-first-launched-after-login/21143 Using the Wayland-enabled Firefox was tested on pure X11 systems by contributors on the #nix-mozilla:nixos.org room and we are confident this change will not cause severe regressions. Even better, people can now toggle `MOZ_ENABLE_WAYLAND=<0|1>` in their environment to override this decision, should they feel the need to do so.
4c5d7c1
to
c156bdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have been using this for years, works great.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/16 |
Please read the commit message for details.
TL;DR: Always set
MOZ_ENABLE_WAYLAND=1
to prevent XWayland usage on Wayland.Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notesFixes #163206