Live data from Hacker News

I hate: Programming Wayland applications

p4m.dev

81–90 of 184 posts

Re: I hate: Programming Wayland applications

#81
post #11

Earlier quoted context omitted.

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.

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…

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, by just making DPI a per monitor variable, which was done long ago.

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 settings but providing instead some "window scaling" settings, 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. I never had to fight with those desktop environments, but I assume that even those would have worked correctly with HiDPI, when using xrandr to configure X11, instead of using the settings of the desktop environment.

Re: I hate: Programming Wayland applications

#82
post #46

Earlier quoted context omitted.

How often has that been a problem for desktop OSes?

Constantly. Phishing, tech support scams, supply chain attacks on e.g. NPM, problems have been rampant since we connected desktops to the internet.

I mean specifically things that using using Wayland will improve.

Re: I hate: Programming Wayland applications

#83
post #6

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 t…

Win32 has managed to do this without any API change, all the existing APIs work. The same approach would've worked for X11.

What it does is simple - all the functions that deal with windows/handles or events simply do not work on ones that you don't have access to, for example, the EnumWindows function allows you to wall through the tree of windows simply do not see the ones the process has no access to. SetWindowsHookEx which allows you to intercept and modify messages meant for other windows simply doesnt fire for messages you're not supposed to access.

Granted, outside of UWP apps, the application of security is rather lax (this is for legacy purposes, the security's there, just not enforced), but for apps running as admin, or UWP apps, the sandboxing is rather solid.

Re: I hate: Programming Wayland applications

#84
post #16

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.

You should know that the constant criticism is basically what stabilized systemd - the core - and stopped systemd - the project - from stretching its arms over every component in the ecosystem, which obviously could create a single-point-of-failure. The upstream has made and still makes stupid assumptions that are totally denied by distros. You’re basically missing a lot of details here.

Re: I hate: Programming Wayland applications

#86

Earlier quoted context omitted.

Not impossible, it just needs to be implemented at a different layer. The compositor needs to expose some API for global hotkeys. For example, I found this with ~2 minutes of Googling: https://wayland.app/protocols/hyprland-global-shortcuts-v1

> Not impossible, it just needs to be implemented at a different layer. The compositor needs to expose some API for global hotkeys. That's a big problem . When things become an optional extension for a compositor, that means you cannot reliably deploy something that depends on it to Wayland. At this moment, things in the wild are coupling themselves to libwayland-client and in practice ossifying its ABI as a standard…

xdg-shell is an optional extension for a compositor and yet you can reliably deploy things that depend on it. You're barking at the wrong tree.

Re: I hate: Programming Wayland applications

#87
post #73
post #6

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 t…

> X11 was a security disaster. This only matters if you compare properly sandboxed apps, otherwise an app that runs with your uid can still do harm and practically indirectly completely compromise the system.. Are most flatpaks _properly_ sandboxed? Of course not.

And X11 always had a mechanism for isolating clients as well, i.e. trusted and untrusted clients. Nobody used it because it was irrelevant before sandboxing.

Re: I hate: Programming Wayland applications

#88
post #24

I agree that the lack of standardization around the "insecure" things is a bad idea. Insecure operations don't have to be available by default, or even universally supported, but a central registry of interfaces for e.g. retrieving all windows on a desktop would certainly help preventing fragmentation. At the same time, most of this post really is just a rant essentially saying that a low-level library is so flexible…

The API design has nothing to do with security. The Posix API is completely secure. MS has been able to bolt on exactly this kind of security to Win32.

Re: I hate: Programming Wayland applications

#89
post #66
post #7

Earlier quoted context omitted.

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 w…

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…

I was going to point out that wayland is a protocol & surely there must be other ways to do this. But your point about mesa expecting wayland-client is a very tight binding here.

Anyone know of exceptions? People who get mesa working anyhow, some way?

It also doesn't preclude people from making nicer experiences on top of libwayland. Again I'd be curious to see what material is out there. It feels like a library that materializes the current state of things into a local view would go a long way to dispel the rage of people such as the author here, who seem to detest callbacks with firey rage.

The idea of the wayland registry seem unifying & grand to me. Ok yes it's async & doesn't hide it? Lot of ink spilled to be upset about that, and doesn't feel like an immutable fact that must govern life, if that for some reason makes you as mad as this dude.

Re: I hate: Programming Wayland applications

#90

Earlier quoted context omitted.

Especially systemd. Declarative management of services is a bad thing? Some people just wanna complain

Yeah Wayland I get. It's still kind of janky even after almost 20 years. Complaining about Systemd makes no sense though. It works very reliably, switching to it caused no issues, and it has fixed a number of problems with the Linux desktop. Some people just want to live in the 80s forever.

"Some people just want to live in the 80s forever."

I think this shaming of free software users that want to make other choices is rather terrible.

Post reply on HN