9 ms·
Wayland vs. X – Overview
- tapoxi 3y ago[flagged]
- bufio 3y agoHas Wayland fixed the fact that compositing sucks by definition?
- wffurr 3y ago“Sucks” I mean if you want tear free rendering there’s not a lot of choices other than compositing.
- acdha 3y agoWhat useful discussion were you expecting from this question? All major window managers use compositing so clearly “sucks” cannot be globally true. Is there some specific problem that you have encountered?
- SilverCode 3y ago"combine (two or more images) to make a single picture, especially electronically" ... sucks? I can't even begin to think how you would present multiple windows to a user if you didn't composite them into a single image. Even if you are doing a 3D virtual desktop, you still have to composite the layers down to 2 single slightly offset images.
- account42 3y agoCompositing in the context of window management hase a more specific meaning: https://en.wikipedia.org/wiki/Compositing_window_manager https://en.wikipedia.org/wiki/Compositing_window_manager vs. https://en.wikipedia.org/wiki/Stacking_window_manager https://en.wikipedia.org/wiki/Stacking_window_manager There are advantages and disadvantages to both approaches. Note that X.org is traditionally a stacking window manager but has had the compositing model bolted on for a long time now.
- yencabulator 3y agoCompositing WM is not "versus" stacking WM. Practically all mainstream Wayland desktops are floating ("stacking") based UI paradigms, while using compositing to construct the final screen image. The wikipedia article you linked to shows examples of stacking window management on the compositing window manager page! Are you thinking of tiling WMs? The major tiling Wayland compositors support floating windows when you want them, too.
- account42 3y agoNo, from the Wiki article on stacking WMs (empahsis mine): > A stacking window manager (also called floating window manager) is a window manager that draws and allows windows to overlap, without using a compositing algorithm. All window managers that allow the overlapping of windows but are not compositing window managers are considered stacking window managers, although it is possible that not all use exactly the same methods. It's possible that you have another definition but for me (and it seems for Wikipedia) the distinction is that a stacking WM does not keep buffers for individual windows but instead has them draw directly into the desktop buffer (details vary, the programs themselves might not have access to the buffer but send pixmaps that get blitted there). This results in lower resource usage and fewer copies but requires programs to redraw newly exposed regions when you move a window which may result in visible artifacts when programs cannot render fast enough.
- Zambyte 3y agoSure, if you don't like composition you could use something like cage[0] [0] https://www.hjdskes.nl/projects/cage/ https://www.hjdskes.nl/projects/cage/
- jbverschoor 3y agoIsn't only the transport layer of X insecure? That could be swapped out with another layer. With Wayland you have to use VNC which is fine for local networks, but not for remote ones.
- addicted 3y agoFrom what I understand, and I’m no expert on this, X pretty much broke application sandboxing. X’s design was inherently insecure in the context of modern OS security practices.
- asveikau 3y agoI think you're phrasing that incorrectly. There was no application sandboxing for X to break. And you can't build sandboxing atop X. You speak as if application sandboxing within the ever existed in the past... Not that people tried to build it and X doesn't play well with it.
- gpderetta 3y agoI don't profess to have any deep knowledge of X11 or Wayland, but I don't understand how sandboxing can't work in X11. XWayland exists and it is either non-sandboxed (hence Wayland doesn't add any security benefit) or it is. And if it is it means that X can be sandboxed and it should be possible to run XonX sandboxes. Something like xnest.
- asveikau 3y agoThis is a very good comment. I guess then the claim is more that no common implementation is amenable to sandboxing, and the compatibility break of a brand new protocol means they can implement it from day 1 in the way they like. Which is a lot weaker an argument, but practically speaking, it's true that no one is rushing to bolt on security features to X. To be clear I'm not realy a Wayland fan.
- hedora 3y ago
- bogwog 3y agoFrom my understanding, the biggest problem with Nvidia cards atm is the lack of explicit sync support in Wayland, which is something that is actively being worked on by both Nvidia and others. That said, I've been using Nvidia+Wayland+KDE on my workstation for over a year now and while there are problems, it's certainly useable.
- mouse_ 3y agoX was so insecure that wayland maintainers must now work tirelessly to roughly emulate these insecurities such as taking screenshots and sharing their desktop in their new protocol. Don't get me wrong; I don't like X, but if I had it my way we'd all be using Haiku with a Linux or BSD kernel right now.
- BenjiWiebe 3y agoIf those are insecurities, I want an insecure desktop. I use my computer to get things done, not be a paradigm of security.
- vlovich123 3y agoThose aren't inherently insecurities, but the way X implemented them was quite insecure. Wayland is now having to do the heavy lifting of defining a secure protocol to implement it and migrating the entire Linux GUI ecosystem to using the new mechanisms. Also, I can take screenshots just fine on Wayland via KWin. I can't pick arbitrary 3p apps just yet but KWin's screenshotter is fine. Not sure about screen recording as I haven't needed that. VNC-style applications don't work but if you do a search you come up with sunshine+moonlight which uses Nvidia's protocol + H264 streaming.
- troyvit 3y ago> Wayland protocols hit 1.0 in 2015 and [...] (from further up in the thread[1]) > Also, I can take screenshots just fine on Wayland via KWin. I can't pick arbitrary 3p apps just yet but KWin's screenshotter is fine. Maybe in another nine years Wayland users can choose whatever screenshot tool they want. X is annoying but I'd go crazy if that was my life. [1] https://news.ycombinator.com/item?id=38709188 https://news.ycombinator.com/item?id=38709188
- nolist_policy 3y agoYou can wait 9 years and have a low chance of your screenshot tool working on Wayland. Or you can use a different tool that supports Wayland now. Or you can can add Wayland support to your favorite tool now (assuming it's open-source).
- ACS_Solver 3y agoYour prediction is probably right but it highlights what I still find to be a fundamental problem with Wayland. It's something that's very much user-facing, as it affects the behavior of desktop environments and several types of programs. It's also something that developers want because they don't want to write X applications or maintain Xorg itself. The disconnect is developers want Wayland to replace X ASAP, while users want a smooth experience where nothing breaks due to it being Wayland, which is a high bar. For me, Wayland remains one of the least favorite technologies I've dealt with. As a developer, I needed to port a custom Linux system to hardware that only has Wayland drivers and it was a giant pain. Wayland offers no advantage at all for that system but it broke a lot of functionality that relied on X in terms of window placement, etc. Took weeks of work to get a more complicated system that does 90% of what the previous one did, while still missing a few convenient features. As a user, I try Wayland once in a while on one of my computers. It's improving - or more precisely, it's not Wayland itself but rather Wayland support of other software, like KDE. Earlier this year I finally worked under KDE/Wayland for a couple days with no issues, but then I again ran into some weirdness when using Unity so once again back to Xorg. What really makes Wayland hard to daily drive for me is that I have zero issues with Xorg. I don't use the things X can't do at all (fractional scaling is one I think?) so the bar for Wayland as a daily driver is admittedly a very high one, it needs to be completely free of issues because Xorg already does everything for me and Wayland's advantages are for the devs, not for me as a desktop user. It also feels like it's improving slower than anything else has. Printing on Linux used to be a pain but now it works well. Wifi on Linux was hard to get working at some point but now it just works. Sensationally, gaming on Linux has become as easy as it is on Windows. Wayland protocols hit 1.0 in 2015 and now nine years later, it's approaching usability.
- yjftsjthsd-h 3y ago> As a developer, I needed to port a custom Linux system to hardware that only has Wayland drivers and it was a giant pain. Wayland offers no advantage at all for that system but it broke a lot of functionality that relied on X in terms of window placement, etc. FWIW, I've had decent luck running cage ( https://www.hjdskes.nl/projects/cage/ https://www.hjdskes.nl/projects/cage/ ), then on that xwayland, and then just ignoring wayland and running X clients. The result does still have some slight quirks, but it mostly works fine.
- ndiddy 3y agoMy main issue with Wayland is how big of a missed opportunity it is. If you're going to introduce a massive breaking change like this to modernize the Linux desktop, the least you can do is make it an actually compelling design. Wayland was originally created to fix the parts of Xorg that made it difficult to use it for embedded devices (digital signage, car infotainment systems, etc), so the base protocol only defines enough functionality to make that use case possible. Anything more complex than that requires using a complicated patchwork of Wayland protocol extensions, some of which are specific to certain compositors and many of which duplicate the X11 protocol extensions they're intended to replace. I'd be surprised if Wayland isn't more complicated to use than X11 in a few years. Additionally, Wayland is already showing its age. The example that first comes to mind is how events are handled. Device events are received from the kernel and placed in a 4KB buffer that clients are supposed to read from and process. If the buffer fills up without being processed (for example, if high CPU or I/O stress causes a program to get descheduled for a few seconds and the user moves his mouse over the window), the compositor will sever its connection with the program, causing it to crash. This wasn't a problem for Wayland's initial embedded use case, but if you're trying to use it on desktop with devices such as high-polling rate mice it makes it far more unstable than X11 unless you have enough system resources to guarantee that no program will ever have its event handler thread pause for any reason. See here for more information: https://gitlab.freedesktop.org/wayland/wayland/-/issues/159 https://gitlab.freedesktop.org/wayland/wayland/-/issues/159 I wish that the "X11 is showing its age and should be replaced, but Wayland isn't the right option" viewpoint was more mainstream.
- bzzzt 3y agoI don't see how a client application blocking its main event handler isn't broken? If you're going to do lots of work or blocking I/O you spin it off to another thread so UI updates will be handled without pause.
- ndiddy 3y agoOn desktop we don't have realtime scheduling. Processes can get descheduled for arbitrary amounts of time. This issue happens with well-behaved applications that don't block at all on their main event handler threads when the system is under high CPU or I/O load.
- beeboobaa 3y ago> It's better now So it actually works now? Last time I tried switch to Wayland I also had to switch from i3 to Sway which just flat out refused to run until I gave it some hilariously insane command line argument like --my-next-gpu-wont-be-nvidia, and even then just crashed. Demanding your users buy different (expensive!) hardware is obviously a non-starter. Especially if you want to do ML. Good luck without an nvidia card.
- account42 3y ago> They needed to do this Few things are ever truly needed. Those things don't include Wayland. That doesn't mean there are reasons for it but it does mean you can't just discard the downsides. > Xorg was complicated And Wayland will be complicated too by the time its mature. Especially when you include all the other compontents needed to provide the same functionality as X.org > Xorg was [...] insecure Under what threat model? Personally I have no interest in the zero-trust model needed for proprietary app stores and would rather not pay the cost. > the maintainers moved on to Wayland A lot of those maintainers are employed by Red Hat and other corporations. They moved because their employers have reasons to move to Wayland - those reasons don't neccessarily matter to all users. > Nobody else wanted to take up the mantle of maintaining an X implementation. Isn't it a bit early to pronounce that. X is mature software. It works just fine for most people. Why would you expect someone to immediately jump at messing with it?
- bzzzt 3y ago> Under what threat model? Personally I have no interest in the zero-trust model needed for proprietary app stores and would rather not pay the cost. Under the threat model of websites using browser exploits to grab other data on your system? Or under the threat model of company policy or legislation not allowing you to handle confidential information on a system that can't offer even a basic guarantee of privacy.
- yjftsjthsd-h 3y ago> Or under the threat model of company policy or legislation not allowing you to handle confidential information on a system that can't offer even a basic guarantee of privacy. Last I'd checked, Windows had the same security issues as X, so it's unlikely to come up.
- bzzzt 3y agoUntrue. Windows has permissions for capturing the screen which you have to enable on a per-application basis. Next to that Windows has an even stronger permission model regarding DRMed content. But thats only to please movie studios it seems...
- asoneth 3y ago> Nobody else wanted to take up the mantle of maintaining an X implementation. This is the most surprising part to me. Despite the volume of end-user complaints I haven't seen any developer stepping up to take over the soon-to-be deprecated X.Org Server or advertising their alternative X implementation. Even if it remains niche like the various systemd alternatives it seems like a lot of people would be grateful.
- bityard 3y agoThis could use a (2012) tag. (And the better link to use is this one: https://wayland.freedesktop.org/docs/html/index.html https://wayland.freedesktop.org/docs/html/index.html)
- icarito 3y agoI suffer from the limitations of both X11 and Wayland. Some things work in one and not the other, it's a trade off. In Wayland I can use different scaling for each monitor (in exchange for a LOT of RAM). But in X11 I can use Barrier to share my mouse / keyboard with my other computer. So I use one when I have a second monitor and have to restart my session when I use a second computer :'( Please fix this!
- superkuh 3y agoIt will be fixed on some Waylands with libei, but it will never be fixed on other waylands that find libei distasteful (like sway). And that's the waylands in a nutshell: many different things, never "wayland" always "waylands".
- westurner 3y agolibei looks useful. But IDK why libei is necessary to run Barrier with Wayland? For client systems, couldn't there just be a virtual /dev/input/XYZ that Barrier forwards events through And for host systems, it looks like xev only logs input events when the window is focused. Is xeyes still broken on Wayland, and how to fix it so that it would work with Barrier? With Barrier, when the mouse cursor reaches a screen boundary, the keyboard and mouse input are then passed to a different X session on another box until the cursor again crosses a screen boundary rule. Barrier is a fork of Synergy's open core: https://github.com/debauchee/barrier https://github.com/debauchee/barrier libei: https://libinput.pages.freedesktop.org/libei/ https://libinput.pages.freedesktop.org/libei/
- yencabulator 3y ago> For client systems, couldn't there just be a virtual /dev/input/XYZ that Barrier forwards events through You seem to be asking for kernel thing, not something Wayland. But let's assume you wanted a protocol on top of Wayland to do this: Why can't arbitrary Wayland clients always see the mouse pointer, snoop on the keyboard, and inject keypresses? Because of security, by design. Why is it taking a bunch of work to provide that capability in an access-controlled way? Because it's a bunch of work. For example, quoting libei: "However, the events are distinguishable inside the compositor to allow for fine-grained access control on which events may be emulated and when emulation is permitted."
- edent 3y agoI don't know what I'm doing wrong with Wayland. I have a cheap Linux laptop, with built in graphics. And Wayland works perfectly. I can run multiple monitors with one of them rotated. When I tried that with X I got lots of juddery tearing. I can take screenshots and share my screens via video calls. But everyone says it doesn't work due to security. I have fractional scaling and it doesn't seem to burn out my CPU or battery. Yet that's frequently listed as a disadvantage. What do I need to do in order to make Wayland as bad as everyone says it is?
- ladyanita22 3y agoOn the fractional scaling side, precisely Wayland's advantage is that it works much better there than in Xorg. Regarding the rest, I run an Nvidia laptop under Wayland since early 2022 and it's been working flawlessly. It's true that I'm using one of the cleanest, most forward thinking distros out there: Fedora. On Ubuntu it had way more issues than on Fedora, though.
- 2devnull 3y agoI guess that’s a good way to think of Federora, forward looking. I always liked it for other reasons, but they do have just the right amount of forward focus. Ubuntu has a very different community to try and satisfy, so has to move slower.
- ladyanita22 3y agoYes, I agree. I understand why RH splits Fedora and CentOS Stream.
- acomjean 3y agoUbuntu and Nvidia are difficult. We have a Linux work station and attempt to get an Nvidia card working (drivers anyway) failed. Its was confusing and even those with more skill/experience couldn't make it work. PopOS (which is a fork of Ubuntu) with Nvidia ended up working for us. Though I'm not sure if its X or Wayland.
- rhabarba 3y agoWayland won't work well on non-Linux systems, and this is intentional. So, for the foreseeable feature, it can't replace X because its developers don't care.
- craftkiller 3y agoI've been running Wayland (sway) on FreeBSD flawlessly for years.
- DonHopkins 3y agoThat totally misses the point. How about running Wayland on systems that a non-negligible number of people use, like Macs? Or even an enormous number of people, like Windows?
- vetinari 3y agoWhy should be Windows or Mac support a concern for Wayland compositors? DWM or Quartz authors don't care about Linux either.
- rhabarba 3y agoTo be fair, X (VcXsrv) works on Windows and (XQuartz) pre-M1 macOS.
- vetinari 3y agoThey do, yes. Nobody will prevent anyone trying to port Wayland compositors, either. If that's your itch, feel free to go for it. But the Wayland compositor authors will steer their software to run effectively on Linux. If that means it is difficult to port to Windows or Mac (whether because they miss dma-buf, or demand something that the native platform won't provide to non-system process), so be it.
- nolist_policy 3y agoAnd Windows apparently has a Wayland compositor for WSL
- politelemon 3y agoShould it be possible to run games with Steam on Wayland with Nvidia drivers installed? Or is that some ways off while we wait for NVidia drivers to be updated? I did give it a brief try but getting very low fps, which tells me it's probably running on CPU if I had to guess.
- anton96 3y agoI feel like the debate between Wayland and X always bring more a general discussion about technology refactoring and modularity. To me be, the big question is not why freedesktop.org or redhat is doing all of this, they're a company and they have their needs. It is why distro maintainers have chosen to adopt those technologies(systemd,Wayland, others?), not that those options are especially bad but to me,but they really look like a clear bifurcation from the modularity and customization we used to see on the distro world. I remember the mid 2000 and early 2010, when computing was still cultivating this cool image from the animations of Mac os Leopard and the aero style of Vista and the leader above all in the form compiz crowning Linux from far. In the talks around Wayland vs X, the maneer Wayland proponent(not only its developer and also any linux user) dismisses critics of missing feature because 15 years later they're still not standardized or lack of composabilty between windowing and compositing is a stark contrast with the way we used to talk about free and open source software at the turn of the millennium. We used to defend customizability and a certain form of freedom. Sure X11 lack security and should be replaced by something that works better. The Wayland shortcoming are defended in the name of security is some kind PR speak I wouldn't think I'd see in the linux world years ago. It comes as particularly bitter as other closed platform from wich we used to hear a lot corporate speak still allow apps to do more things with their own windows that Wayland does. The fact that the same organization hosts flatpack but has not vision of how to use the capability model for Wayland really poses questions on the vision. All in all, I wonder if things would have went more smoothly and in greater general agreement if those 15 years+ were spend make Linux work like plan 9. Edit: typoes/syntax
- smoldesu 3y agoWayland is still customizable, and x11 isn't going away. If you want to trade in security and maintenance for features and capabilities, nobody will try to stop you. In that sense, distributions still don't hold much power over the user besides what they present as default. > The fact that the same organization hosts flatpack but has not vision of how to use the capability model for Wayland really poses questions on the vision. I disagree, and I'm a staunch GNOME skeptic myself. Flatpak and Wayland were both built as extensible systems from the start, and GNOME's implementation of both technologies is just one interpretation of the protocol. KDE is a good mirror example; their Wayland implementation exposes many features completely unavailable on x11, and their Flatpak permissions are integrated right in the Settings app. Personally I don't like GNOME's approach to the desktop anymore, and I refuse to defend most of their more opinionated decisions. Those choices have a minimal impact on desktop Linux outside of GNOME though, and it more feels like Red Hat is displacing the amount of work put into keeping legacy systems alive.
- superkuh 3y agoIt should probably be "Waylands vs. X" since each of the Waylands supports different features and libraries to try to achieve the same ends. For example, some of the waylands use an external library, libei, to be able to support features like being able to share mouse/keyboard between computers. But some waylands, like sway, are actively hostile to libei and have made a point of never supporting it. So some waylands can share mouse/keyboard and some can't. There is no wayland. Just waylands.
- yencabulator 3y agoBy that logic, there is also no TCP, HTTP, HTML, Linux, x86, ...
- ur-whale 3y agoSo, here's one thing I need to know: X can open a window on another machine over ssh Can Wayland do the same?
- RealCodingOtaku 3y agoYou can do it with waypipe[1]. But Wayland itself doesn't support remote rendering by choice[2] as it is outside its scope. [1] https://gitlab.freedesktop.org/mstoeckl/waypipe/ https://gitlab.freedesktop.org/mstoeckl/waypipe/ [2] https://wayland.freedesktop.org/faq.html#heading_toc_j_8 https://wayland.freedesktop.org/faq.html#heading_toc_j_8
- ur-whale 3y agoSo remote in Wayland is a bag on the side that requires work and integration. Hard pass on wayland right there. At least until it offers RR natively (meaning: I don't have to waste hours of my life to get it working).
- yencabulator 3y agoSecure remote in X11 is a bag on the side that requires work and integration. SSH has to explicitly transport it for you, carefully setting it up the right way. Even worse, SSH has to meddle with X11 internals to prevent your desktop session being trivially pwned by the remote.
- jgb1984 3y agoYou can pry xorg + openbox + tint2 + polybar from my cold, dead hands!
- tamimio 3y agoWayland works perfectly fine on my T480, no complaints with multiple monitors sometimes.