by pavlov · 2y ago · 0 comments
Instead of cutting its losses early and dumping X11, both the Unix vendors and open source spent far too long trying to make lemonade out of a truckload of rotten lemons. And that’s why Linux GUIs are so far behind.
It’s notable how rapidly Apple was able to evolve their Unix GUI because they were not tied to X11 and instead embraced the integrated model, even designing their own GPUs nowadays.
Apple rapidly evolved their GUI because they are trying to support just the one. And, frankly, they are starting to buckle on the idea that they are fully coherent.
I disagree. Other platforms did similar things where clients would command the OS what it should draw and the OS would handle all app's rendering which allowed for good performance on primitive hardware. Like other display severs X did evolve to also be for passing around framebuffers of what the app drew once hardware became capable. X's problems come from being hard to maintain, being a monolith of unrelated concepts, having poor security, etc.
Direct3D on Windows: app renders something and calls IDXGISwapChain.Present. The implementation communicates with the desktop compositor running in the dwm.exe process, dwm.exe renders the entire desktop composed of multiple windows, then communicates with physical GPU to wait for next vertical blank event.
Bare metal Linux with DRM: app renders something, calls drmModePageFlip(), then waits for next vertical blank event with poll() and drmHandleEvent() functions. Embedded Linux developers did an amazing job about DRM/KMS, in my experience the API is both reliable and efficient.
X Window systems have multiple different methods, glXSwapIntervalEXT, glXSwapIntervalMESA, glXSwapIntervalSGI, but in practice none of them is reliable, and on some systems none of them is even supported. Unfortunately, this makes rendering tear-free 3D content on X11-based desktops hard-to-impossible.
Hardware accelerated 3D graphics is the best way to render pretty much everything on modern hardware, games or not games. High-resolution displays are omnipresent. Even cell phones often have FullHD or more pixels, like 2796×1290 or 2556×1179 in the iPhones.
There are some old applications on Windows that aren't DPI-aware and look weird, but usually fixable. It's still a million times better than whatever X11 does.
IMO macOS is the only OS where graphics and fonts work the exact way one would expect reliably.
Trying to separate X from the client/server model would be like saying: "I like Unix just fine, except files and processes and the shell and the software tool philosophy, really." — You just don't have much left.
I also disagree that the client/server design is a problem. Modern graphics hardware is remote from the CPU for all intents and purposes. So remote buffer manipulations protocol is exactly what is needed.
But, a few days ago, I finally switched over, on a modern machine (~ 6 months old), with a modern OS (more than modern -- I'm running a pre-release version). And now, finally, I see what all the fuss is about. Wayland is absolutely beautiful. The rendering and animations are gorgeous, and so so smooth. The whole system is far faster, far more robust, and far more efficient both in computing resources and workflow than anything I was ever able to achieve on X.
I have been using Linux on X11 displays as my primary machine since 1996. I do development work, but not with graphics, where I'm just a regular user. I don't really care about how good the design is or how hard it is to write programs using X / Wayland / whatever. All I care about is how usable my system is. And for me, having reached the Wayland promised land, I now understand what I was missing with X, in a way that I could never have before.
Tear-free rendering, all the time, every time. Frame perfect windows, all the time, every time. A desktop that finally feels immediately responsive, all the time, every time. Under X11, all those round trips to and from the X server add milliseconds to response time, hard to benchmark, but very easy to feel. Worse yet, X11 responsiveness is variable. If the system is loaded, your desktop can lag so badly under X. This doesn't happen with Wayland.
I now have OSD volume controls that work even when the screen is locked. This was never possible with X, and can never be possible.
I now have a lockscreen that, guaranteed, will not leave my desktop unlocked if someone crashes it by feeding it malicious input. X11 is architecturally incapable of providing such guarantees. There were several instances of security bugs where lock screens in X11 crashed in exactly this way.
Wayland has now reached the point where it is a must-have for me. If it doesn't run Wayland, I won't buy it, and I won't install it. Yes, X11 works well after all these years, but Wayland is enjoyable to use in a way that X11 never was.