Title

  • kevincox@lemmy.ml
    link
    fedilink
    arrow-up
    76
    ·
    2 years ago

    Back in the day X was a great protocol that reflected the needs of the time.

    1. Applications asked it to draw some lines and text.
    2. It sent input events to applications.

    People also wanted to customize how their windows were laid out more flexibly. So the window manager appeared. This would move all of your windows around for you and provide some global shortcuts for things.

    Then graphics got more complicated. All of a sudden the simple drawing primitives of X weren’t sufficient. Other than lines, text and rectangles applications wanted gradients, rounded corners and to display rich graphics. So now instead of using all of these fancy drawing APIs they were just uploading big bitmaps to the X server. At this point 1/3 of what the X server was previously doing became obsolete.

    Next people wanted fancy effects and transparency (like drop shadows). So window managers started compositing the display. This is great but now they need more control than just moving windows around on the display in case they are warped, rendered somewhere slightly differently or on a different workspace. So now all input events go first from X to the window manager, then back to X, then to the application. Also output needs to be processed by the window manager, so it is sent from the client to X, then to the window manager, then the composited output is sent to X. So another 1/3 of what X was doing became obsolete.

    So now what is the X server doing:

    1. Outputting the composited image to the display.
    2. Receiving input from input devices.
    3. Shuffling messages and graphics between the window manager and applications.

    It turns out that 1 and 2 have got vastly simpler over the years, and can now basically be solved by a few libraries. 3 is just overhead (especially if you are trying to use X over a network because input and output need to make multiple round-trips each).

    So 1 and 2 turned into libraries and 3 was just removed. Basically this made the X server disappear. Now the window manager just directly read input and displayed output usually using some common libraries.

    Now removing the X server is a breaking change, so it was a great time to rethink a lot of decisions. Some of the highlights are:

    1. Accessing other applications information (output and input capture) requires explicit permission. This is a key piece to sandboxing applications.
    2. Organize the system around frames to avoid tearing except for when desired (X doesn’t really have the concept of a frame).
    3. Remove lots of basically unused APIs like fonts, drawing and many others.

    So the future is great. Simpler, faster, more secure and more extensible. However getting there takes time.

    This was also slowed down by some people trying to resist some features that X had (such as applications being able to position themselves). And with a few examples like that it can be impossible to make a nice port of an application to Wayland. However over time these features are being added and these days most applications have good Wayland support.

  • nous@programming.dev
    link
    fedilink
    English
    arrow-up
    52
    ·
    2 years ago

    Applications needs some coordination between each other in order to act like you would expect - things like one window at a time having focus and thus getting all keyboard and mouse inputs. As well as things like positioning on the screen and which screen to render to, the clipboard, and various others things.

    X is a server and set of protocols that applications can implement to allow all this behaviour. X11 is the 11th version of the server and protocols. But X was also first created in 1984, and X11 since around 1987. Small changes have been made to X11 over the years but the last was in 2012.

    Which makes it a very old protocol - and one which is showing its age. Advances in hardware since then and the way we use devices have left a lot to be desired in the protocol and while it has adapted a bit to keep up with modern tech it has not done so in the best of ways. I also believe its codebase is quite complex and hard to work with so changes are hard to do.

    Thus is has quite a lot of limitations that modern systems are rubbing up against - for instance it does not really support multi cursors or input that is not a mouse and keyboard. So things like touch screens or pen/tablets tend to emulate a mouse and thus affect the only pointer X has. It is also not great at touchpads and things like touch pad gestures - while they do work, they are often clunky or not as flexible as some applications need.

    It is also very insecure and has no real security measures in place - any GUI application has far more access to the system and input then it really requires. For instance; any application can screen grab the screen at any point in time - not something you really want when you have a banking web page open.

    Wayland is basically a new set of protocols that takes more modern hardware and security practices in mind. It does the same fundamental job as X11, but without the same limitations X11 has and to fix a lot of the security issues with X.

    One big difference with X though is that Wayland is just a protocol, and not a protocol and server like X. Instead it shifts the responsibilities of the X server into the window manager/compositor (which used to manage window placement and window borders as well as global effects such as any animations or transparency). It also has better controls over things like screen grabs so not every application can just grab a screen shot at once or register global shortcut keys or various things like that. Which for a while was a problem as screen sharing applications or even screenshot tools did not work - but over time these limitations have been added back in more secure ways than how X11 did them.

      • NateSwift@lemmy.world
        link
        fedilink
        arrow-up
        14
        ·
        2 years ago

        In theory yes. In practice most X11 applications can be ran using Xwayland as a compatibility layer

        • nous@programming.dev
          link
          fedilink
          English
          arrow-up
          9
          ·
          2 years ago

          Additionally any application using a GUI toolkit (like kde, qt or gtk etc) only needs to to update to a version that has native Wayland support. Which means most applications already support it. At least if they don’t use any X11 APIs directly (which is not that common).

  • lloram239@feddit.de
    link
    fedilink
    arrow-up
    33
    arrow-down
    1
    ·
    edit-2
    2 years ago

    X11 is an multiple decade old dinosaur, the developer decided it was growing too complex and no longer representing how graphics are done on modern systems and decided a rewrite. While doing so they decided to simplify some things along the way and in doing so they drastically overshoot their target and removed tons of fundamental functions that was present in X11 (stuff like being able to take screenshots, window manager, etc.). Some of that is slowly getting reimplemented and Wayland is getting closer to actually being a feature-parity X11 replacement, but it’s also taken 15 years and is still not done. The whole drama is the conflict between people wanting it as default and the other group of people for which it simply doesn’t work in its current state.

  • jackpot@lemmy.mlBanned
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    2 years ago

    x is slow and dumb but the standard, wayland is fast and based but still being worked on

  • d_k_bo@feddit.de
    link
    fedilink
    arrow-up
    19
    arrow-down
    6
    ·
    2 years ago

    X.com is a centralized internet platform that is known for hatespeech, harmful content and being controlled by a single person with questionable opinions.

    Wayland.social is part of a federated internet platform that is known for its diverse communities, independence from any centralized authorities and interoperability with other federated internet platforms.

    /s

  • Grain9325@lemmy.ml
    link
    fedilink
    arrow-up
    13
    ·
    2 years ago

    X is old and works for the most part but fixing stuff or adding features is hard.

    Wayland is new and is supposed to be a successor to X, do what it couldn’t do and don’t repeat the mistakes from it. It should be a drop-in replacement like pipewire but isn’t. Features take long time to develop as devs are engrossed thinking of the best solution to make it happen. A lot of proposed solutions are dismissed as well.

    • LeFantome@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      2 years ago

      I think the drama around Wayland can be explained by the sentence “it should be a drop-in replacement like pipewire but isn’t”.

      Without taking a side on that issue, I will point out that this was not a goal for the Wayland designers ( in their own words - I do not have time to go find a quote but have read this sentiment many times ). Wayland detractors agree with your sentence and, given that expectation, are legitimately upset and even confused that Wayland continues to gain mind and market share against X11.

      If you feel that Wayland needs to be a drop-in replacement for X11, it is not ready and may never be. By that metric, some people see Wayland as a failed technology and perceive Wayland users as shills and zealots.

      If you are interested in a display server that addresses some of the core design problems in X11 and do not mind moving to something new, Wayland is starting to look ready for prime-time.

      If you are non-technical and / or unopinionated the debate is probably irrelevant. Wayland will most likely become the default on whatever Linux distribution you use sometime in 2024 or 2025. You will be a Wayland user. Maybe you already are.

      If you are willing to step outside the mainstream, using X11 without Wayland is going to be possible for at least another decade. That said, I am saying “outside the mainstream” because not only will popular Linux distributions and desktop environments start to become Wayland only but the innovation is all going to move to Wayland. There will be many Wayland-only compositors, apps, and features. 5 years from now, not using Wayland is going to really limit the desktop experience. I expect some toolkits ( GTK, Qt, and maybe even WINE ) to drop X11 support at some point ( maybe not soon but sooner than 10 years maybe ). 5 - 10 years may seem like a long time but it will likely come faster than X11 stalwarts expect.

  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    1
    ·
    2 years ago

    There is t really a whole thing. Wayland is where Linux is going as the people who developed X11 say it is insecure and it’s to hard to fix the issues so they went and started Wayland. They should have called it X12 or something then there would probably be less complaining.

  • hperrin@lemmy.world
    link
    fedilink
    arrow-up
    9
    arrow-down
    3
    ·
    edit-2
    2 years ago

    Basically a long time ago Linux/Unix was run on big machines in a separate room with all the fancy graphics hardware, and you’d have a dumb little machine at your desk that could barely draw pixels on a screen. So X11 was designed with all these fantastic neat server-client mechanisms that made it great for running on a mainframe.

    Fast forward 30 years and all that stuff is useless now that everyone has built in graphics (as well as several other issues with X11’s archaic design). So some smart people who didn’t know any better made a new thing that everything has to be rewritten for (because they were smart, but didn’t know any better). Then someone who did know a little better was like, what if we take the old bloated one and rewrite it for the new lean one. So now everything runs in an X11 session inside a Wayland server, which has to be rewritten for everything because Wayland is a protocol, not a server.

    But one of the really nice things about it is that everything has to be rewritten, so we can make newer, fancier bugs.

    Edit: I don’t want you to take the impression that I think Wayland is bad. Wayland is way better than X, it just sucks that we have to rewrite a bunch of stuff for it and figure out new ways of doing things that were dead simple in X, but very insecure.

    • kevincox@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      2 years ago

      Also window managers started compositing which moved 1/3 of what X was doing to the window manager. Then applications started doing their own rendering which moved another 1/3 of what X was doing to the applications. All that is left over is basically the low-level IO which had gotten greatly simpler over the years and could basically be packaged into a few libraries (mesa and libinput primarily) and some complex mutli-hop IPC which was completely unnecessary.

  • satanmat@lemmy.world
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    2 years ago

    Okay ELI5

    X11 is a win doing system. It is old and has been around for years.

    Wayland is a new one.

    They both are the core that a gui sits on.

    Wayland has some great new stuff but some people don’t like change

  • Mikina@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    I’ve recently switched to Nobara, and has been unsure whether to go with Wayland or X11. Mostly because I’ve read that Wayland has issues on NVIDIA GPUs and will perform slower, so I went with X11 (On KDE). Is that still the case nowadays, or can I just use Wayland?

    • ThePancakeExperiment@feddit.de
      link
      fedilink
      arrow-up
      4
      ·
      2 years ago

      I am on arch and use both KDE+Wayland/X11 on my 3060ti and for me wayland still has lots of visual glitches, some programs flicker, sometimes the plasma bar is frozen, etc., etc… Gaming is hit or miss. But I can say, the things that do work are a lot smoother than on X11.

    • RenardDesMers@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      It’s easy to give it a try. You just have to select it at the login screen and see for yourself if you’re impacted by any issue.

    • jacksilver@lemmy.world
      link
      fedilink
      arrow-up
      22
      ·
      2 years ago

      Not OP, but the point of asking for an ELI5 is that sometimes you don’t even know where to start. For example I clicked the link you provided and only have more questions as I don’t really know what people mean by display servers, etc.

      Sure I could look everything up and try to understand, but the hope is someone in the community might provide a better or faster summary than what can currently be found online.

      • baru@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        3
        ·
        2 years ago

        Something similar has been asked loads and loads of times. It’s not needed to investigate, just searching for previous discussions is enough. It sometimes surprises me that people don’t read one of the many times the same was asked before. That said, despite the same questions coming up many times there’s often multiple people who will gladly explain things. So I agree that it doesn’t make sense to complain about it. I’m a bit surprised that nothing would come up though. It really gets asked regularly.

        • superbirra@lemmy.worldBanned from community
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          yeah, but the time of web forums with losers banning you because you couldn’t find a post from 17 years earlier on the same subject is long gone. YAY!

        • jacksilver@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          I get your point. I don’t know about OP, but I hadn’t seen a similar thread, but I usually browse all so easily miss posts for specific communities.

          Also, I’ve found search on Lemmy hit or miss. The federation aspect of everything makes search sometimes difficult or confusing. For example, what community would most likely have already provided an ELI5 post and how would it have been phrased?