Discussion
Foundational Differences
jmclnx: I can say I hate all GUI programming! Luckily, all my professional programming deals with back-end processing, so I was able to avoid GUIs :)So I feel your pain. I did hear programming for Wayland is harder than X11, but I never did either so I have no idea if that is true.
zabzonk: Seems like complaining about how difficult to use Win32 and COM are. And they are if you use them directly! You don't do that - you use libraries that others have sweated over, as you did with raylib.
65a: As a user, I like wayland. X11 was a security disaster. Wayland is much better about tearing.What scares me though are all the responsibilities passed to compositors, because what ends up happening is that each compositor may reimplement what should be common functionality in annoying ways. This is especially true for input things, like key remapping. This ultimately fragments linux desktop experiences even harder than it was before.
eqvinox: Huh. The "security" preventing me from doing things I want to do is a major reason I dislike Wayland :/. (e.g. automation & scripting / input events, clipboard, ...)It also has noticeable mouse lag for me, I really hope this isn't due to avoiding tearing.
DonHopkins: The Decompositing Compositors, there's nothing much anyone can do.https://www.youtube.com/watch?v=HMKaM3FdsgY
diath: Wayland was designed from the point of view of theoretical purists. It's basically "how would a display server work in an ideal world", unfortunately, that design turns out to also be impractical and straight up developer/user hostile.
dzogchen: It is a damn shame that tools like xdotool (automation) and sxhkd (global keybinds) are impossible to recreate under Wayland.
zer00eyz: > how would a display server work in an ideal worldWhen designed by committee.With conflicting interests.And Veto Powers.
James_K: I'm using Sway right now and I have key binds. Not sure why you think that's impossible.
izacus: The constant loud bile spewing over Wayland and systemd just won't stop here, will it?It's getting a bit boring, especially since none really does more than complain.
vatsachak: Especially systemd. Declarative management of services is a bad thing?Some people just wanna complain
flexagoon: But haven't you heard that systemd is an evil project made by Microsoft to somehow destroy Linux and make everyone use Windows? It must be true because I saw it on Reddit.
calvinmorrison: A security disaster? Howso?
AshamedCaptain: Well, it allowed local users to actually use their computers for computing instead of just safely consuming "apps" -- obviously that needed to go.
James_K: Reminds me somewhat of Vulkan. I think the trend of making the actual specification of something lower level and less convenient is rather logical. Why burden implements with a load of convenience functions when that could be left up to libraries?
Krutonium: wdotool exists, and global hotkeys are a thing under wayland, but is desktop dependent. KDE allows it by default, Gnome can be made to do it as well with an extension.
vatsachak: Callbacks are bad?
cactacea: Yes.
flexagoon: ydotool existshttps://github.com/ReimuNotMoe/ydotool
m132: Letting any GUI application capture all input and take full control of the desktop completely defeats the point of sandboxing and X11 does exactly that.
motorpixel: Writing 1300 lines of non-cross-platform windowing code sounds like masochism. GLFW is right there.
ceayo: > Defeats the point of sandboxingSandboxing defeats the point of said applications. If you want your computer to have no functionality, check out Figma. A clickable prototype sounds like precisely the security the world needs right now.
javier2: I have used quite a bit of Gtk and QT, and have had to touch X11 or Wayland very little directly, EXCEPT for one case where I wanted to provide a global hotkey...
cies: Which is kind of understandable as Wayland tries to be more secure: and thus in Wayland not all keyboard events are propagated to all applications (that's what X11 does). I think it's a good idea to put security first in this iteration of FLOSS desktop technology.
IshKebab: Well kind of. It'll be several decades before we see any practical benefits - at the moment once you have local execution you can do anything you want - accessing other apps or even root is trivial.
bjourne: Here is how to get Win32 up and running: https://learn.microsoft.com/en-us/windows/win32/learnwin32/y...It's absolutely trivial in comparison. Same thing with Xlib; < 100 lines of C code is enough for a simple app.
zwarag: Not only that. A11y is also quite hard. Tools that are simple to implement thanks to good a11y apis - for example on macos, the tool rcmd or homerow - are super hard to do in Wayland.
righthand: Systemd sucks though for good reasons.
bbor: Poor soul — they missed `wlroots` in their googling! You’re not supposed to be solving these issues yourself.
201984: He's writing a client, and wlroots is a library for writing servers. It would not have helped at all.
vidarh: Th point is the decoupling. sxkhd runs irrespective of wm and means your en can optionally choose not to handle key bindings at all. With Wayland you end up depending on whether or not and how your compositor supports it.
ape4: He complained there is no way to do the easy thing in Wayland - there is a way: Gtk and QT
flohofwoe: ...which is overkill when you only need a Vulkan or GL canvas which spans the windows client area... and even with GTK or Qt your app still stands out like a sore thumb on the "other" desktop environment because the window chrome doesn't match the rest of the system.
201984: How do you make a global hotkey in all compositors with Gtk or Qt?
graemep: That is a strawman. That is not the aspect of systemd people object to.
IshKebab: They looked at caniuse.com and thought "I want that!"
fonheponho: I have no love lost for Wayland, but this:> Make easy things easy. Make hard things doable.is generally unachievable. Instead, pick one:- easy things easy, hard things impossible- easy things tedious, hard things possible(Unless you want to maintain two sets of interfaces in parallel.)
jampekka: This is quite easy and very widespread to accomplish by having helper functions for common operations.
flohofwoe: Tbh, 1300 lines of code to open a frigging window and GL context deserves that bile. Such a fundamental problem is also nothing that can be fixed except discarding the whole clusterfuck and starting from scratch.
James_K: How many keybings do you have and how often do you try new window managers? Compromising the security of the whole system just to save you a few `sed`s when writing some config files seems like a bad trade off.
cogman10: Exactly my impression. And honestly, X11 isn't exactly beautiful like the author is implying. A lot of the same wayland complaints they are putting here apply to X11. The main difference is that wayland is apparently handling the event loop for you while X11 expects you to set that up yourself.Win32 has exactly the same setup of problems here as wayland does. Moreso because Win32 just gives you back opaque handles which you are expected to keep track of and use the Win32 API to do any meaningful interactions.The only understandable complaint is that wayland makes it hard for different windows to interact with one another for security. IMO, that's a silly goal to chase after, but that's just me.
hedgehog: Having done some mobile development where app sandboxes have been prevalent for years, it's annoying to deal with but necessary. Given the bad behavior some devs attempt, often ad SDKs trying to perma-cookie users, stealing clipboards, etc, having a platform that can support app isolation seems necessary for normal desktop usage.
graemep: How often has that been a problem for desktop OSes?
hedgehog: Constantly. Phishing, tech support scams, supply chain attacks on e.g. NPM, problems have been rampant since we connected desktops to the internet.
ceayo: Poor sould -- they should have googled `wlroots` before their commenting.
201984: A big complaint in TFA is that Win32 is much much easier to use than Wayland is:>Getting any example application to work is so incredibly ridiculous, that every second I program on Wayland, I yarn for the times I did Win32 programming.And that comes from the core of how Wayland is designed.In Win32, the stable interface / ABI is the set of C functions provided by the operating system through DLLs. These are always dynamically loaded, so Microsoft is free to change the internal interface used for controlling windows at any time. Because of this, decades-old .exes still run fine on Windows 11.In Wayland, the stable interface is the binary protocol to the compositor, in addition to the libwayland-client library plus extensions. Instead of that socket being an "implementation detail", it's now something that all programs that just want to make a window have to deal with. You also can't just use the socket and ignore the libwayland libraries, because mesa uses libwayland-client and you probably want hardware acceleration.The other big issue is the core Wayland protocol is useless; you have to use a bunch of protocol extensions to do anything, and different compositors may implement different versions of them. On Win32, Microsoft can just add another C function to user32.dll and you don't have to think about protocol how that gets transformed into messages on the socket layer, or compatibility issues with different sets of extensions being supported by different compositors.
torginus: I would at least like to understand the idea of 'pureness' this API tries to aspire to.It's definitely not Unix-like, since file handles and writes and epoll, and mmap for IPC are nowhere to be found. Instead you have 'objects' with these lifecycle methods that create/release resources (probably committing the design sin of having these for things which should be pure data, like descriptors).What's with these XML headers? It's UNIX standard stuff, to have a C API for your code, that declares an API for a library, and then a makefile can just consume it. There's a standard way of supplying, finding and consuming them. Even binding generators are probably more comfortable with C headers, than this XML thingAnd what's with the callbacks for everything, like screen resolution queries? In Win32, you can do it with a single synchronous API call that returns a struct that has all the info. It's not like you have to touch the disk or network to get this. In cases where you do, you usually have a call that dispatches a message to another window (which you can also dispatch yourself), and you have to listen to the response.I did some X11 programming as part of work, and its entirely reasonable and conventional compared to this, much more like Win32 (even maybe a bit more pleasant, but I'm no expert on it).The API sounds awful (and I've had ChatGPT generate me some example programs, and it's somehow even worse than the author describes), and not only that, the requirement of 'everything be an object', with chains and trees of objects being created introduces a huge source of bugs and bookeeping performance overhead on the application side.Yes, you do have to do something like this with some things under Windows, but the reason for this is that these objects have duplicates in the Windows kernel.But here it looks like this is just to satisfy the sensibilities of the designer.Honestly this sounds like the most epic case of NIH syndrome. Like these guys wanted to write their own OS and userland and break with existing conventions.
mato: I used to program pure Xlib when I was 13 or so. I don't think the then-13-year-old me would manage pure Wayland.
atomicnumber3: The point of wayland, though, is that back then 13-year-old you would get an application that "works" but to support myriad things (like HiDPI) you'd have to DIY it. Whereas now, sure a 13 year old perhaps won't write directly to wayland's APIs, but you'll use a library and have a much more globally usable result. And honestly probably have a better time - less effort for the same result, and with a more maintainable project in the long run.
adrian_b: HiDPI has always been perfectly supported by X11.The only problem that has existed is that originally there was a single DPI value, not a different DPI value for each monitor.This has never created any problem for the people using multiple monitors with the same resolution, but only for the people who have used multiple monitors having different resolutions and who might have not liked the changes in windows size when moving a window from a monitor to another monitor.That was indeed a problem, but it really affected a rather niche use case and it was also trivial to solve without any change in the X11 design.So criticizing X11 about a supposed problem with HiDPI is incorrect. I have used only multiple 4k monitors with my PCs, with X11, for more than a dozen years and I never had any problem with HiDPI, with the exception of many Java programs written by morons, which ignore the system settings and which also do not allow the user to change the font used by them. I do not know which is the problem with the Java programmers, but I never encountered programs with such a behavior, except those written in Java. Moreover, the Java programs are also the only that had problems with monitors using 10-bit per color component.While X11 itself never had problems with supporting HiDPI, at least not in the XFCE that I am using, I heard that other desktop environments have created problems with HiDPI that have nothing to do with X11, by not exposing the X11 DPI setting but providing instead some "window scaling" setting, which is something that I do not know how it is implemented, but there are good chances that it is implemented in a wrong way, judging from the complaints that I have seen. I cannot imagine how one could use correctly a "window scaling" factor, because the font rendering program must know the true DPI value when rendering for instance a 12-point font. If rendering is done at a wrong DPI and then the image is scaled, the result is garbage, so in that case it would not be surprising that people claimed that HiDPI works badly in X11, when in fact it was Gnome or whatever desktop environment was used who was guilty for bad support, not X11.
bleudeballe: Sure puts the Wayland in Weyland-Yutani