3 ms·
> I've developed cross-platform applications and it was enough work without the extra headache they describe Wayland brings. Have you tried wayland-client? Whe
by dadoum 1y ago
> I've developed cross-platform applications and it was enough work without the extra headache they describe Wayland brings.
Have you tried wayland-client? When I made my custom application framework, since I had no previous experience I decided to start with wayland-client library, and then figure out what to use for X11.
My experience with it is that it is painfully sensible. Things fail when misused, which happens a lot (probably also because only few people actually wrote code with it so I was on my own to understand how to do stuff), but at the end they were fixable, and the only gripes I had were the protocols that GNOME didn't implement at the time. But I guess, if they are not implementing it right now, it means that they think it's okay if it does not work. (and actually I could also defend a lot of missing things in Wayland protocols, like the fact you can't position windows yourself)
On the other side, X11 just looks like a mess. When you start it feels like you have 2 options, XCB and Xlib. Old posts say that XCB is the modern one, but nobody uses XCB so in fact you may encounter bugs. Error handling is really poor, most of the errors are small messages written in stdout. You ask for things called "Atoms", and you send them/attach them to the X window. No feedback on whether it works or not, they mostly have weird names with prefixes like _NET_WM or _MOTIF. If you want to make an OpenGL window, for a long time it was not possible if you used XCB because GLX requires you to give Xlib handles, then came EGL-XCB which was supported by almost no driver because for some reason it seems that you need driver support for each X library you may want to use. When you start you're reminded of a slew of somewhat niche concepts today, like Visuals, Seat, Back pixel, Front pixel, which you are probably not expected to use today (in detail, I know, visuals may be useful in some small use cases, I don't know why the app is in charge of selecting the seat though, and pixel stuff is probably a dead thing). At the end the only thing that makes X11 bearable in my opinion is the fact that people wrote a lot of code with it so you can search on the Internet for the most part and find a snippet of code that should work for your use case.
- immibis 1y agoTo get past this, you have to learn that X11 is a protocol, not a library, and learn the protocol and then use the library to send protocol messages, instead of learning the library, which is how it's unfortunately taught and also how Xlib was unfortunately conceived of being used. Xlib was designed so you'd use it similarly to say Win32; that idea was a colossal failure. xcb is more closely aligned with the idea that it just helps you format network packets.