by kruuuder · 3y ago · 0 comments
Edit: Thanks for all the responses. But I'm still not understanding what all this has to do with Firefox. I boot up my linux machine that runs KDE, I launch Firefox and then what? Does this help with something on my local machine? Or does Firefox now provide a UI for remote systems that I SSH into? Whatever Firefox can do now, why should this be a feature of a browser?
Edit 2: Ah, I get it now, Firefox simply renders itself using the Wayland protocol, correct?
Essentially, in an operating system you need a way to "draw" things on the screen. And a way to properly "move" the boxes "draw".
Previously, the usual* way to do that was using XServer (XOrg). Now you would imagine that the server would take commands from applications, and would draw them. But it was the inverse (for various historical reasons)! However, the most egregious thing was that it ALWAYS ran as root. And while tries had been made to reduce the attack surface, it had to fundamentally change (I am skipping over other parts related to performance, scalability, or future proofing).
And that's where Wayland comes in, and literally flips the whole thing on its head. Now the issue is XOrg has been around for maybe 40 years or more ! And that was not going to change easily. Distros did their absolute best to allow double use, but adoption grew very slowly. Eventually, supporting and testing for two envs will grow complicated.
Anyway long story short, almost everything about Wayland is better IMO, actively supported and is the future. But migrating to it has been complicated because they were undoing 40 years of habits, hardcoded bugs that grew into features, and had to come up with new testing.
This is something I typed up rather quickly so please take a peek at the Wiki page for Wayland you will find a much more complete history
That hasn't really been a thing for over a decade now. As a decent metric, https://wiki.ubuntu.com/X/Rootless says Ubuntu switched to rootless by default for most drivers in Lucid==10.04
In the old world, they talked to an X server that implemented the X protocol. It's not KDE drawing stuff to your screen, it's X, but KDE is a little special in that it can move windows around and draw title bars and borders. This is called a window manager.
Two big issues with X, this was defined in the early 90s by a consortium of Unix vendors and is somewhat of an overly complicated nightmare.
It's also a security nightmare, any app can snoop on any other app.
Wayland is an attempt to simplify things. The server, called a compositor, is much simpler and is implemented as a library, usually by former window managers that now actually handle drawing stuff to the screen. Applications can no longer snoop, they must ask permission.
If you run an older app designed for X, it uses an almost invisible compatibility shim called XWayland, basically a tiny X server that takes in X draw commands and converts them to Wayland ones. Firefox enabling Wayland support means that on most modern systems, it no longer has to use this shim.
Wayland is a step forward for desktop Linux, but like any big change there are some annoyances. The asking for permission model means things like screensharing tools or apps that do weird shit like macros or capturing keystrokes need to be updated to ask permission. Nvidia didn't really support Wayland well until very recently because they got into some weird argument about driver APIs that took years to resolve.
I swear I've been reading this for a decade.
Wayland meanwhile actually has 99.9% of what you need working today not 25 years from now. There's some bits and pieces already progressing well and likely to be fixed in the next few weeks/months/years and not 25 years in the future. Very different situation to X11, IMHO.
I encounter the same thing when dealing with code reviews as well - people love to document the WHAT or HOW of things, but rarely if ever consider talking about WHY it matters, or WHO it matters too.
To borrow from a favourite corpo speak: answer the "so what" for the reader to make something actually useful to more people.
Wayland looks a bit more likely to achieve its goal, but we'll see. For my part, it'll take a long time yet before it's worth the hassle to consider switching.
[1] https://en.wikipedia.org/wiki/General_Graphics_Interface
Until recently, "Xorg" was the main centralized implementation of a display server on unix-likes, and any program wishing to display graphics had to speak its native protocol, "X11". Now many systems run display servers which speak a new protocol, "Wayland"[note]. While a compatibility shim does exist (XWayland), ideally a program wishing to display graphics on such a system should do so using the new protocol directly, for better performance and features.
Porting an application to a new graphics backend obviously requires some effort and testing. Until now, out of an abundance of caution, Firefox simply spoke the old X11 protocol by default, even when running on a new Wayland system, relying on the XWayland compatibility shim. Now Firefox is essentially announcing that they believe their Wayland backend is robust and complete enough to enable by default.
I hope this helps!
[note] the nature of Wayland is such that there are many implementations of such servers, not just one main one like with Xorg. This is because the semantics of the Wayland protocol have taken over some of the functions previously handled (on X11) by a separate piece of software, called a "window manager", which contributed heavily to the look, feel, and behavior of a particular desktop GUI. Thus, while Xorg was agnostic and could be shared by different GUIs, with Wayland each GUI system must implement its own display server.
Window managers can be separate with Wayland too. It just seems like the Wayland people don't want to unify under one implementation and have separate window managers.
You could add Wayland support to an existing VR compositor, but that wouldn't force you to combine the window manager into the same process.