this post was submitted on 29 Apr 2024
476 points (96.5% liked)
linuxmemes
20880 readers
5 users here now
I use Arch btw
Sister communities:
- LemmyMemes: Memes
- LemmyShitpost: Anything and everything goes.
- RISA: Star Trek memes and shitposts
Community rules
- Follow the site-wide rules and code of conduct
- Be civil
- Post Linux-related content
- No recent reposts
Please report posts and comments that break these rules!
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The TLDR was really helpful NGL
So it's software that handles software wanting to display things on the screen. Because having each piece of software do it itself would be not only chaos but a massive security concern. And it's a big deal because it fixes (by replacing) the old software with something that's easier to work with than the old ways of doing things (due to all new code that's not spaghetti that's hacked together over decades).
Am I close?
Not really, the main point is that (most) apps don't know where they are on the screen, whether they're minimized, on the active workspace, ... and they don't care either. That's the responsibility of the window manager.
The app tells the display server "I need a window to display these pixels" and that's it. And the window manager, well, manages these windows.
On the topic of security, X11 doesn't handle security at all, that's one of the main issues. So any graphical app can read the other windows' pixels, grab everything you type, everything you copy, ... OTOH Wayland isolates apps so they can't do that by default. Apps that really need to (screenshot apps, ...) can use "portals" to ask for these permissions.
That's really interesting and thank you
I think I'm beginning to get it now, and Wayland does sound better than X11 at least
I use wayland, but be warned that there are downsides.
X11 is 40 years old. Which means that even though it has 40 years of bad decisions baked into it, it also has 40 years of features and tooling built around it.
And in some cases, things are purposefully broken in the name of security as mentioned above. Writing a keylogger on X11? Easy. Every app can watch the keyboard even when they aren't in focus. So if I type my password into firefox, Discord can listen. Hope you don't have any malicious apps just patiently listening to all your keystrokes.
Getting rid of input listening sounds great! .... Except for the concept of global keybinds. Have a Push to talk button in discord that you need it to be able to listen to while youre playing a game? Sorry, the game is in focus, so discord can't see ANY of your input. Including the push to talk button. Different wayland servers have different ways of handling this with their portals. Some don't have it at all. And the ones that do don't always have great solutions.
One major issue that has been in wayland debate hell... how do multi-window apps communicate with each other. For example GIMP. The editor window is a separate window from the toolkit which is a separate from the layer view. GIMP on X11 knows where all of its windows are because it can see everything. if you wanted GIMP to save all the window positions, it could. GIMP on Wayland has no idea where each window is relative to each other. Each window knows its own size and shape. And thats it. It doesnt know where on the screen it is. Which means it doesnt know where it's other sub windows are relative to itself. Which means GIMP on Wayland can't really save the window positions for next run. Wayland is working on a protocol for handling this, but its been caught up in debate hell last I saw. This is a prime example of a thing X11 had. And Wayland will someday have, but the 40 year headstart and disregard for security gives X11 a huge headstart.
Most of these problems have workarounds and solutions, but you might find yourself in a situation where you do in fact need to implement a workaround instead of having everything Just Work.
"Better" means different things to different people. Architecture and security and technologically? Wayland is better. Just Works and its what your apps were probably built to run on so less weird edge case issues? X11 is still better just due to inertia. (And again, I use Wayland, I'm willing to deal with the workarounds, but you do you).
Does it also handle key and mouse inputs to make sure they're interpretted by the right programme in the right context?
Yep that's also the WM's job.