21 comments

[ 3.1 ms ] story [ 48.2 ms ] thread
For those that miss it, there's multiple pages. If you go back one page (by hitting the left arrow link), you get an introduction and table of contents.
The XCB tutorial is quite good as well https://xcb.freedesktop.org/tutorial/

Also, if you want to do simple graphics stuff with X11, then I highly recommend looking at https://www.cairographics.org/ instead of trying to use the builtin drawing functions that come with X11.

Author here. I don't want to copy/paste my entire postmortem in here, so I'll link to the thread from a few days ago which has some extra context into why I started this series, and why I stopped it, as well as future projects I've since moved on to.

https://news.ycombinator.com/item?id=21041340

> pick up a piece here or there, and go on straight to bashing Wayland, gleefully unaware that I was one of the people making it.

Don't worry, you working on Wayland doesn't make it any less sucky, it is broken at a design level so unless you had a fundamental effect on the design, you don't bear any blame for its state :-P.

(though a better approach would be to try and fix X11's issues instead of intentionally breaking it and replacing it altogether)

That's exactly the comment that makes me feel validated in leaving the Linux and FOSS worlds behind. Why would you post something like that?
Because i believe Wayland is fundamentally worse at a design level than X11. Why else would i post something like that?

And i too have lost interest on Linux (on the desktop at least) over time (incidentally also working on games but that is just a coincidence) and a main reason for that is all the push that Wayland gets despite its shortcomings from various big players. Wayland is most likely going to become the primary tech behind Linux desktop, but that wont be due to its merits, it will be due to the push it gets from companies with money.

Xorg is not a simple project and most people who may want to work on it will be hobbyists who more likely than not, wont be able to keep up with whatever breakage Wayland introduce. You can already see this sort of inability to keep up with "modern Free Desktop" breakage by looking at the projects that are developed by hobbyists in their free time and how slow they are in adapting from Gtk2 to Gtk3 - some still haven't fully adapted, yet Gtk is now breaking things again with Gtk4.

If only all that breakage was for something worthwhile. But in reality there is absolute no reason, yet is forced on everyone. Desktop programs in the 80s drew buttons, checkboxes, input fields and sliders. Desktop programs in the 90s drew buttons, checkboxes, input fields and sliders. Desktop programs in the 2000s drew buttons, checkboxes, input fields and sliders. Desktop programs in the 2010s drew buttons, checkboxes, input fields and sliders. I am absolutely sure that desktop programs in 2020s, 2030s, 2040s and forward will continue to draw buttons, checkboxes, input fields and sliders. There is no reason to break those programs, no reason to waste anyone's time rewriting programs that already work just to keep up with lower layer breakage, no reason to introduce additional dependencies just so you can avoid the breakage, no reason to waste time learning how to do the exact same stuff only now in a slightly different way, no reason to do any of that at all.

From my perspective Wayland has no reason to exist. At least no reason that has to do with what would be better for everyone NOT involved in its development.

While Windows has its issues (e.g. i do not like how it forces composition - also a reason i dislike Wayland - and how they remove customization options in a very hacky way) it is still better than Wayland (e.g. my old code still works without changes, i can write code that manipulate arbitrary windows, despite the hacks it is still very fast, etc). At least from my perspective. But i feel like choosing the least of two evils (not that X11 is perfect, but i'd prefer if all the wasted effort that went to Wayland was spent on improving Xorg).

So i decided to stick with Windows. The only way i could see myself doing what i believe is right is work full time on Xorg, toolkit(s) that take advantage of Xorg (instead of treating it as a dumb bitmap terminal) and programs that work with these toolkits. But i cannot do that and even if i could, the constant FUD against X11 from Wayland developers and fans make me wonder if it would be worth the effort in the first place.

FWIW i do not mind Wayland existing (even though i see no point in it personally) as much as i do not mind Arcan existing - or Qt existing, Gtk3 existing, ZSH existing, Ruby existing and any other project that provides an alternative option to another project. What i do mind is the manipulation going on to force me (indirectly mainly, through all the efforts going on - yes i know that technically nobody puts a gun on my head) to use Wayland. If i'm going to be forced something might as well be something i dislike less and due to the vast majority using it it has less problems.

Hence, Windows.

Well, I won't respond to any of that, I will just say that I was one of the core designers of Wayland, and I've had a very fundamental impact on the design. I understand both X11 and Wayland quite well. So thanks for the insults, I guess.

This is exactly the sort of comment that got me tired of working on Xplain, and why I quit working on Linux entirely. My one wish is that you treat the FOSS graphics communities with more respect in the future. There's a lot of people who have years and years of experience solving problems and dealing with this stuff every day, and their opinions hold a lot of merit.

> So thanks for the insults, I guess.

I'm not sure what you found insulting, i was commenting on Wayland itself and the companies that push it. The closest i could think of is the "blame for its state" bit but that was obviously said jokingly as tongue-in-cheek (even with the ":-P" smiley).

Do you see disliking Wayland, disliking the forces that push it and not seeing a point at it existing as insults to yourself?

> treat the FOSS graphics communities with more respect in the future

A "community" isn't a person to be treated with anything, if i'm to treat someone with respect it will be a person, not something vague like a community.

Also disliking a piece of work doesn't mean that i disrespect (or respect) the person who worked on it. I honestly do not know you so i have no reason to disrespect (or respect) nor insult you (something that from my perspective i didn't do). I do know about Wayland and i have many reasons to dislike it, but that dislike doesn't extend to a general dislike or disrespect of you. It is Wayland i dislike, not you.

> There's a lot of people who have years and years of experience solving problems and dealing with this stuff every day, and their opinions hold a lot of merit.

Sure, but there are also a lot of people who can simply be wrong despite their experience, for a variety of reasons. Appeals to authority aren't to be taken at face value. Also in my post above i'm not judging the people who created the work, i'm judging the work and (also) how it i feel is enforced on me despite my will.

Some people might get too attached to their work and feel any attack towards it is an insult to themselves, but to me that does not sound like a reason to not criticize that work - or any work - especially when that works is affecting me.

Also i think that if you feel insulted by people criticizing your work you may not have a good time working as a games developer :-P.

Because they believe that Wayland is fundamentally broken?
So what have you built? All I see from you is criticism and telling other people not to build things.
What you see is wrong, i'm not telling anyone not to build things. If anything i wrote

> i do not mind Wayland existing (even though i see no point in it personally) as much as i do not mind Arcan existing - or Qt existing, Gtk3 existing, ZSH existing, Ruby existing and any other project that provides an alternative option to another project.

But i also wrote

> What i do mind is the manipulation going on to force me (indirectly mainly, through all the efforts going on - yes i know that technically nobody puts a gun on my head) to use Wayland.

In other words, build as much as you want, just do not force me to use what you built. If i like it, i'll use it. But that is not what happened with Wayland which is forced to people through other projects. As an example see what KWin's developer said some time ago wrt. to X11 in that they wont accept any fixes or features for X11 and everything new will be for Wayland and even if someone does the work it will not be accepted.

That is a clear case of KWin's developer sabotaging X11 in favor of Wayland, not of Wayland having some merits over X11.

Others haven't been as out there as KWin's developer, but i wouldn't be surprised that the reason mainline Xorg lies about the display's DPI (this is patched by most distros out there) instead of reporting the real one was those "Xorg developers" who went on to work on Wayland as having this information is enough for toolkits to implement per-display arbitrary scaling support (one of the supposed features Wayland has over X11).

As for what i have built, i have built a bunch of stuff, but it doesn't matter since they are irrelevant to this discussion and what i have written. What i'm writing matters and it is enough to stand alone by itself, i do not need to appeal to any authority - be it mine or someone else's.

(comment deleted)
Logged in to upvote this because it used the correct: X Window System and not X Windows (Grrrr...) Man X folks! [Apparently OP did.]
How does X interact with your graphics card?
That boils down to two main questions:

1. How do X11 clients render using your GPU, like using OpenGL or Vulkan?

2. How does an X11 server talk to your graphics card to get stuff on screen?

Clients render through a magic secret backdoor. libGL.so / the Vulkan ICD, provided by the vendor talks to their graphics driver, and then there's typically an Xorg extension to do the buffer handoff. In the open-source world, the libGL.so is mesa, it talks to the kernel using a kernel API called "DRM" (Direct Rendering Manager) to render your graphics to a buffer, and then the resulting rendered buffer is shoved across and composited using an Xorg extension known as DRI3, which is initialized as part of the video driver. Most of the open source xf86-video-* drivers support DRI3.

For the latter question, the X11 server has a series of video drivers that can take the buffers you have and show them on screen. I won't go into the exact details of how these buffers are composited (it's not very pretty, but the typical approach these days is the server itself using GL the same way a client would to composite the buffers together), but ultimately a final composited scanout buffer comes out the other side, which is sent to the screen through some driver-specific mechanism. In the open-source world, this mechanism is called "Kernel Mode-Setting", or "KMS", and it's part of the kernel DRM APIs mentioned above.