I stumbled upon this post regarding an earlier rant about wayland, but now it seems fine, according to the author.

After using Linux for nearly 5 years, using both depending on distros defaults, I have to admit that I never got the core/main/game changing differences between wayland and x11.

To be said, that I also dont do fancy linux things other than basic sysadmin stuff and from time to time repair the mess my curiosity left behind.

Could somebody explain the differences between those two and afterwards maybe also say some words about what this has to do with the difference between window managers and desktop environments?

I am also happy about links to good blog posts or stuff, that target this very questions (as long as the questions make sence of course). Thanks beforehand :)

  • juipeltje@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    6 hours ago

    I won’t bother going into technical details about x11 and wayland since other people already explained it much better than i ever could, but basically wayland is supposed to be replacing x11, because the codebase is so old now that it has become very hard to maintain and implement new features without breaking things. A window manager pretty much only handles the placement of windows on the screen, and you have to use seperate applications for setting a wallpaper, getting notifications, application launcher, etc. Whereas a desktop environment is a fully fledged out of the box experience. I personally really like window managers because i like the workflow of tiling window managers in particular, which places the windows in a predefined layout for you. Something that might be a bit confusing is that window managers on wayland are called compositors, which is because in wayland the window manager also has to do it’s own compositing. In x11 you could use something like picom, which is a seperate compositor program that you could use to add graphical effects to any window manager, but on wayland this doesn’t exist and the window manager has to implement its own compositing.

    • MangoCats@feddit.it
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 hour ago

      A shorter take: x11 is old, and big, and didn’t originally consider security much at all.

      Wayland is newer, therefore lacking some bells and whistles of x11 that some x11 users may still care about, but also designed with more awareness of security issues - making it more extensible and maintainable into the future.

      There was a time Wayland wasn’t a great x11 replacement due to its level of development. When it will become the better choice all depends on what kind of user you are, but it seems inevitable to become the better choice for most users in the future.

  • dingdongitsabear@lemmy.ml
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    8 hours ago

    aside from the obvious, wayland being the default choice on all relevant distros and DEs and being continously worked on, evermore projects switching to it (WINE most recently) whilst X11 is in maintenance-mode, the main thing for me and my deployed fleet is if you’re running a modern laptop, say with a 1080p or better screen, wayland is a must. primarily because of the output (UI scaling, effortless multi-monitor dock/undock) and the input (touchpad gestures, touch screens).

    if your world is a desktop with a mouse and, say, XFCE, then you have very few of these things intruding on you and you don’t really understand the benefits benefit from it.

  • jecxjo@midwest.social
    link
    fedilink
    English
    arrow-up
    24
    ·
    16 hours ago

    One thing to note with X11’s design, having a server and client, there was nothing requiring both to be on the same machine. You could run an X11 client on your local machine, ssh into a remote machine and use its X11 server.

    Lets say you are home and can ssh into a work server. You could run Firefox on the work machine, using it’s network and have the visual parts show up on your home computer.

    This was very much a Unix, shared resource style design. Servers and thin clients. Put all your horse power in the big machine and connect using your crappy low power system to it.

    • qaz@lemmy.world
      link
      fedilink
      English
      arrow-up
      12
      ·
      12 hours ago

      Keep in mind that in practice this didn’t work that well, it wasn’t very efficient at displaying modern interfaces over the network. Showing a simple text editor over LAN worked fine, but using Firefox from another place was quite spotty.

    • 𝘋𝘪𝘳𝘬@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      11 hours ago

      Back than I tried this. The performance was horrible, even on a good connection. It was barely tolerable on LAN, but over the Internet … no. Just no. There were and are better solution for accessing a remote machine.

  • Leaflet@lemmy.world
    link
    fedilink
    English
    arrow-up
    70
    arrow-down
    1
    ·
    20 hours ago

    Before Wayland, there was X Window System, created in 1984. X Window System was designed in a time where you had one good computer connected to multiple displays used by different people. X went through many versions but version 11 (X11) stayed around for a long time.

    But the architecture just isn’t good. It wasn’t designed for modern needs. MacOS used to use X, but replaced it to fit modern needs. Windows didn’t use X, but they too updated Windows to fit modern needs. But Linux and other OSs stuck with X for a lot longer, hacking it to make it work. Honestly, it’s amazing how well it does work.

    But isn’t not great. It wasn’t designed with security in mind, it doesn’t do multi-monitor well. Behind the scenes, it considers everything to be one giant display; issues arise when it comes to mixed-dpi displays and when monitor refresh rates don’t match. It’s also just a bloated, old code base that people don’t want to work on. Fixing X would not only be difficult, but would break compatibility.

    So people got working on a modern replacement for X aiming to avoid its issues. Wayland is leaner, more opinionated, and designed for how modern hardware operates. Wayland itself is just a protocol (like X11), and there’s many different implementations of that protocol: Mutter, Kwin, wlroots, smithay, Mir, Weston, etc. Meanwhile X11 pretty much only had one relevant implementation, Xorg. Wayland’s diversity has its pros and cons. Pros include (1) you can create your implementation in any programming language you want rather than being stuck to just one, (2) an implementation can fill just the needs on the person making it rather than trying to generalize it for everyone. But cons include the fact that this fragmentation leads to scenarios where one implementation supports something that others don’t and implementation-specific bugs.

    Wayland’s opinionated design is also draws criticisms. It gives a lot of control to the compositors rather than windows, which is how Xorg, MacOS, and Windows work. Nvidia’s wayland adoption was also slow and terrible. It took many years to get it into the only decent shape it’s in now.

    • guy_threepwood@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 hour ago

      This reads like an AI response to me.

      Mac OS has never used X11 as a primary display system. Apple had a version they supplied with older Mac OS X versions for people using older Unix applications (and half-arsed ports) but that’s been unsupported since 2012. You can still install the modern “XQuartz” open source equivalent, but it’s still secondary.

    • lattrommi@lemmy.ml
      link
      fedilink
      English
      arrow-up
      6
      ·
      19 hours ago

      Excellant write up, thank you.

      I’m not exactly sure what ‘opinionated’ means in terms of software, could you (or anyone who sees this) define it?

      • Leaflet@lemmy.world
        link
        fedilink
        English
        arrow-up
        12
        ·
        18 hours ago

        One opinion that Wayland has is that the client is responsible for decorating its window. It draws its own title bar, shadow around the window, and the cursor.

        Though not everybody was happy with this. A few protocols were created that lets clients tell the compositor to draw decorations around the window and the cursor.

        But still, every app needs to support those client side decorations and cursors because not all compositors support those protocols. Gnome notably doesn’t, they like client side decorations.

    • cornshark@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      19 hours ago

      Thanks for the interesting write up! Why does Nvidia have to “adopt” Wayland? Is it not just fundamentally drawing some textures into some rectangles?

      • Leaflet@lemmy.world
        link
        fedilink
        English
        arrow-up
        11
        ·
        18 hours ago

        Unfortunately not. There’s been a number of things on Nvdia’s side that slowed down Wayland adoption.

        They didn’t always support Xwayland hardware acceleration.

        Nvidia pushed for a technology called EGLStreams while everyone else agreed on GBM. So the desktop stack had to support both. Nvidia eventually relented and started supporting GBM.

        Nvidia didn’t support VRR or night light for a while.

        Nvidia didn’t support necessary stuff for Gamescope to function properly.

        And overall Nvidia on Wayland was just buggy. I remember that many games failed to launch or had weird performance issues. But those issues just went away when I got an AMD card.

        But things are in a much better state today. Though I did recently test a 20 series card on Fedora 41 and it was a terrible experience on the proprietary drivers. But when speaking with orhers, they didn’t share my issues.

        • cornshark@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          16 hours ago

          Why does Nvidia need to support night light? Can’t someone from Wayland just write a simple shader in any shader language that does colour adjustments and apply it to their desktop?

          • Leaflet@lemmy.world
            link
            fedilink
            English
            arrow-up
            8
            ·
            16 hours ago

            The Nvidia driver didn’t support some protocol that AMD/Intel did that was used by desktops for the night light.

            Yes, they could have made the night light work. But why would they when Nvidia said the feature was coming soon? Well it turned out that soon was taking a very long time and eventually KDE actually did create a special night light implementation just for Nvidia. The problem was that it was a hack that had extra overhead. And in the end the hack didn’t get shipped because Nvidia finally starting supporting the protocol.

  • blakenong@lemmings.world
    link
    fedilink
    English
    arrow-up
    31
    arrow-down
    1
    ·
    19 hours ago

    Humorously, X11 is like driving a 1990 Honda Accord. It was built ages ago, but with enough care, it still runs just fine.

    The good news? Over time, you’ve bolted on all sorts of modern conveniences: GPS, Bluetooth, maybe even a backup camera—but at the end of the day, it’s all just stuff you crammed in. Underneath, it’s still the same old car. It’s reliable, it gets great gas mileage despite the half a million miles on the odometer, and it’ll start even when it’s buried under a foot of snow. Sure, it takes some effort to pass emissions, but at least every mechanic knows how to fix it, and parts are cheap.

    Now for the bad news. Anyone with a flathead screwdriver can take it for a joyride whenever they feel like it. You keep finding it parked in weird places, but hey, at least they always bring it back. The airbags? They might work, but there’s only one way to find out. And let’s be honest—most modern cars have surpassed it in every possible way.

    The best part? It’s been paid off for decades. No one is just going to hand you a brand-new car because that would take a ton of money and effort. No matter how much you tinker with it, it’s still a 1990 Honda Accord. You can throw on some new tires, upgrade the suspension, and maybe swap out the brakes, but at the end of the day, it’s never going to have that brand new car feel.

    • 0x0@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      4 hours ago

      it’s never going to have that brand new car feel.

      Worse excuse to write new code, but Wayland does seem to be a good example of rewritting.

    • lemmus@szmer.info
      link
      fedilink
      arrow-up
      5
      ·
      9 hours ago

      Every mechanic does not know how to fix x11, and cannot fix it without extensive knowledge.

    • BritishJ@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      11 hours ago

      But I would rather have 1990 Honda Accord than a new car. But I would take Wayland over X ahah

  • ZWQbpkzl [none/use name]@hexbear.net
    link
    fedilink
    English
    arrow-up
    13
    ·
    19 hours ago
    • X11 is the displayer server, a real process running on your computer.
    • X11 window managers are clients to that server. It communicates with the server and tells it where to draw the windows.
    • A desktop environment is a window manager plus a whole suite of other applications and processes that a common computer user would expect.

    A window manager and display server are the bare minimum of the x11 graphical environment. Desktop environment is draw the rest of the owl.

    Wayland is is a completely different beast than x11. There is no Wayland program, just a wide set of protocols. There are no Wayland window managers, just “compositors”. Compositors are responsible for everything both the display server and window manager would do in x11. Everything is up to the compositor to implement. It just has to follow the Wayland protocols.

    This can make migrating to Wayland a bit tricky. If a program worked in one x11 window manager, it was basically guaranteed to work in all window managers becuase it was always communicating to the same X server directly. In Wayland that’s not guaranteed. If a compositor didn’t (or didn’t correctly) implement a certain subset of protocols then the utility wouldn’t work correctly.

    IE take xrandr and wlr-randr. They both are a , “display settings” CLI utility. xrandr works on any x11 environment because it always communicates with x11. wlr-randr only works if the compositor implements the wlr_output_management_unstable_v1 protocol. See the protocol deifnition here

  • rhabarba@feddit.org
    link
    fedilink
    arrow-up
    1
    ·
    12 hours ago

    The most obvious difference (and absolute showstopper for me) is that Wayland does not work (well) on non-Linux platforms and X11 does.

  • BananaTrifleViolin@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    19 hours ago

    For your second question, a window manager is the specific system that controls the placement of windows on an X11 desktop.

    On a X11 based system, X11 is the windowing system (interacting with the video card) and a window manager is a system sitting on top of that laying out the windows and interacting with the user and other programmes. It is a separate programme on top of the X11 system, and communicates with X11, and X11 is the programme that communicates with the graphics card.

    On Wayland, instead of 2 separate systems there can be 1 combined windowing systen that is both the window manager but also directly communicates with the hardware in a standardised way using the Wayland protocols. This is called a Wayland compositor.

    Meanwhile a desktop environment is the whole desktop - that includes a window manager or compositor but also lots of other tools and software that together make a full desktop experience.

    An example is KDE - KDE is a full desktop environment. It uses its own x11 window manger called kwin (and also able to be a wayland compositor), but it also uses a whole range of other tools alongside that to give you panels, widgets, desktop icons, a clock, menus, settings etc collectively forming Plasma desktop. And then on top of Plasma there is a whole range of bespoke programmes that form the full deskop experience - like Dolphin (file manager), Kate (text editor) and so on. All that software is designed to work seamlessly with the KDE family of tools and systems. The window manager, the desktop tools and the other programmes together form the whole desktop environment. But other desktop environments software will also work - for example Gnome based software can also run with KDE without issue and vice versa.

    Gnome has its own window manager/compositor, and it’s own widgets and tools to make a desktop, and it’s own bespoke software to make a whole desktop environment.

    And there are many others.

    So in summary:

    • Window Manager - the specific system that controls the placment and look of the individual windows talking to X11 which then talks to the hardware

    • Wayland Compositor - the system that controls the placement and look of windows, using wayland protocols to speak to the hardware

    • Desktop Environment - the whole desktop including the Window manager but also lots of other programmes and tools that form the basic desktop (such as a panel, menus, desktop icons) and the whole environment (other software like a file manager, text editor, calculator etc). KDE and Gnome are examples of popular desktop environments

  • thingsiplay@beehaw.org
    link
    fedilink
    arrow-up
    9
    ·
    edit-2
    19 hours ago

    In short, X11 is a bit unsecure in its concept (like every program can read keyboard inputs you are doing right now). The multi monitor configuration possibilities and mixing different setups is basically impossible (I mean stuff like mixing 4k@120 Hz with G-Sync and another one with 1080p@60 Hz with just V-Sync). X11 or XOrg has a long history since the 80s with many versions, the code base is spaghetti code and its not a pleasure for developers to work on.

    Wayland is new, with a fresh and modern code base. It eliminates the security and monitor issues. Programs not written for Wayland does not work, but luckily there is XWayland, which allows running X11 games on Wayland. You can think of like Proton for X11, but without the benefits of Wayland, just a compatibility mode. In Wayland there are sub protocols, meaning standard definitions, that are developed and added after some time passes. I personally think protocols being like an addon that allows doing more stuff in a standardized way across all systems that support it. Developers in Wayland have a much better time working with its modern code base.

    Have a look at https://wayland.freedesktop.org/docs/html/ch03.html .

    • kixik@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      9 hours ago

      Hey, sorry to take adantage of your answer, perhaps you can help me out though.

      Is dbus actually necessary for xdg-desktop-portal? I understand from this flatpak post that xdg-desktop-portal is actually a bunch of d-bus interconnections, which of course make d-bus fundamental for xdg-desktop-portal, but wanted to confirm. xdg-desktop-portal is a must on wayland if one wants to share screen through webrtc, or electron apps like slack or teams-for-linux (probably zoom which is Qt as well). But I’ve read some people (this for example) start sway from console without d-bus, without logind/systemd, just seatd on the background (wlroots and sway support seatd). So perhaps those people are not interested on sharing screen, I don’t know. Or perhaps such d-bus plumbing is only required for flatpaks apps, which are sandboxed, thus requiring all that interconnection to access resources and such, and then I’m not sure about a thing…

      Thanks !

  • Llituro [he/him, they/them]@hexbear.net
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    20 hours ago

    the shortest simplest explanation is that X11 was designed around the idea that multiple user terminals would connect to one large mainframe computer, not everyone just having their own machine like actually became commonplace.

    • kusivittula@sopuli.xyz
      link
      fedilink
      arrow-up
      1
      ·
      10 hours ago

      and you can’t use a shortcut for gnome-pie on wayland :( the workaround is a command line and opens a fullscreen window