by enriquto · 5y ago · 0 comments
This is the only actual, honest, problem that I've ever seen about X. Still, it does not seem a really fundamental problem, it must surely be solvable from within X? Do we really need a full-rewrite of X, unstable, with new bugs and less functionalities? (many of us don't use "desktop" applications and it will break screen capture tools, and other things that are dear to us like xwit, xdotool and the like). Just for that silly mixed-resolution screen problem? I have observed this problem, but to me is a minor, mostly irrelevant nuisance. Losing xwit would be a major problem.
The transition to Wayland is largely finished now. Electron added support last year and eventually the last of the electron apps will update and everything will be done other than nvidia proprietary driver support.
There are so many minor improvements from wayland that are less noticeable like the lack of screen tearing, the possibility of sandboxing apps.
Fedora has has it on by default for about 4 years now and its perfectly usable. I use it every day.
The problem is much more serious than you are explaining. While using X, on my main monitor, UI and text becomes so small I can not even read it or click the icons. I'm not talking about the window size, but the UI and text size. With wayland the app can switch from 200% scale to 100% scale as it crosses the window border. On X you must pick either 100% or 200% and stick with it on all monitors.
Can Wayland handle this? If not, what's it really solving?
I really am curious what features you think wayland is lacking. I've been using wayland for years, both using Sway and Gnome, and the thing I've missed the most is xdotool, and perhaps there will be a standardization effort to replicate its functionality securely, but for now it's an understandable omission.
Maybe it's not fair to say that X is broken for mixed-DPI configurations, since I have managed to get it working with X, but it was quite unreliable, whereas on wayland it just works, save for some incompatible electron apps.
X gives you two options: set DPI per displays. The thing is, you cannot drag windows between displays, the app has destroy it, connect to another one and recreate it here. There's even no mechanism to detect multiple displays other that user setting up the DISPLAY env variable.
Or you can do, as the Xorg does: use multiple screens on a single display. Here, the limitation is, that all screens have to have same DPI.
Neither of those are acceptable for modern display server.
> it will break screen capture tools,
It is a good thing that they are broken, because what they do is snooping on windows that do not belong to them. Just like it is unacceptable to integrate user address book to your app by going through its internal files, it is unacceptable to screen grab by snooping windows of other apps. In both scenarios, your app must go through API, which puts the user in the control, whether the app is allowed to do that. Wayland enforces such protocol for screen grabbing and input handling; those app who do not bother... well, the train will leave the station without them.
> other things that are dear to us like xwit, xdotool and the like
Same as previous, but for input handling.
> Just for that silly mixed-resolution screen problem?
No, there are multiple problems. For another, surely you would like screen lock that doesn't flash your desktop on unlock?
> I have observed this problem, but to me is a minor, mostly irrelevant nuisance. Losing xwit would be a major problem.
See even here on HN, it is important for many. Just few days ago there was a discussion under article about i3 and how to drag it into hidpi world in 2021. On the other hand, the mainstream user doesn't even know why they would use xwit, even if they knew it exists.
The limitation is not true. Yes, the core protocol gives you a single, global DPI value. However, who cares about the core protocol? You have XRandR, which gives you a per-screen DPI. Alternative, you could have a freedesktop standard/convention where the DPI is stored as a global property of the root window, in a array of values, one for each display, so that you can override them.
Problem solved! I am actually running Gtk+ slightly patched to support that... trouble is, most of the toolkit is hardcoded to assume a fixed display or even process-wide global DPI, or at least it was when I last looked at it. Dunno what they did for wayland.
I really don't understand why we need to throw away an entire 30 years of software development just because the current property for storing the DPI only has space for 1 value instead of 1 array of values, one per monitor. Just use a new property.
Not so fast!
Are you going to patch it to decade old binaries? How are you going to handle that Wordperfect from 1998? It certainly won't respect you new protocol.
How the compositors are supposed to handle that?
If you are not going to handle it, and just let it behave as it behaves today, you are still not achieving your goal of scaling all clients properly, and kind of throwing away that 30 years of development by making it unusable anyway.
You need to put in some type of kludge which is the reason this article exists in the first place (e.g. copy paste will work randomly).
And if the toolkit is linked dynamically, you are very lucky... Not to mention that a more realistic scenario is that you have to update a 20 year old toolkit to support multiple DPIs, in which case it is much easier if you just have to read the property from a different place rather than having to target a different display protocol entirely. You made the program vendors life easier at the cost of making yours harder...
The same way Apple handles a PowerPC-compiled application from 1998.
By incrementing to a new major version number, and stating in the changelog that users are free to keep running the older version if their software won't be patched.
Does Wayland provide a better solution than that? No, and in addition it also breaks a lot of newer applications. We don't need to do a lot of math to figure out more people would miss Xorg than Wordperfect.
Don't want to derail this discussion anymore, but this argument is nuts. If you are so concerned that programs that you run can spy on other programs that you run, how do you deal that the fact that all of these running programs have full read-write access to all files on your $HOME?
EDIT: I agree that being able to run selected programs inside a sandbox would be a good thing (maybe even all programs). But attacking the problem of visible display before that of hidden files seems ridiculous. Moreso if it cripples copy paste, screen capture, and similar basic stuff (which to me are just like unix pipes: ways to make programs work together!)
They don't necesarilly do; if you are running flatpak, chances are that they don't.
For example, there is a flatpak for MS Teams. For application like this, you want it to be able to share your screen, but it doesn't have any access to your $HOME (in this specific case, only to ~/Downloads).
More importantly, if you want to tight up your desktop, why do you criticize something that starts attacking it from one angle, that it is not 100% solution? It is not; others are working on the other angles, and then together it will be the 100% solution. In this case, Wayland is only one piece of puzzle, not the entire puzzle.
I think the difference to xwit is that it does not work across windowmanagers/compositors, because much of what X11 used to do is now the job of the compositor, but I assume the users who script xwit likely also have a very tuned windowmanager, so it's unlike they switch window managers all the time and they could therefore just tune their environment for the same functionality as xwit.