by roenxi · 7y ago · 0 comments
Wayland is a good experiment, and the community may well go with it because X11 is atrocious and Wayland is a viable alternative. But call a spade a spade, they dropped the ball with that design decision. It isn't a big deal.
The practical outcome is that there is going to be a screenshot protocol and everything that implements Wayland is going to have to implement that protocol as well. The required negotiation for that to happen is taking/going to take years and delay Wayland adoption. If they'd designed that at the same time as an optional part of the Wayland protocol it would have saved time and confusion.
Linux fragmentation is a real thing, but if the community is going to take multiple years to reach a consensus on the right way to approach screenshots, that does at least somewhat suggest to me that leaving it out of the base protocol may be a good decision. My understanding is that the point of Wayland is to be a semi-permanent solution to the problem of X11. Any mistakes we make in the protocol will haunt us for decades, not just years.
That concern makes me more likely to err on the side of reaching consensus before core logic is implemented, even though I admit that the fractured nature of the Linux community is likely to make process take a lot longer. I'm not saying that nothing should be standardized, just that if it looks like there's disagreement over implementation, it might be a good idea in this specific case to bias towards delaying a final decision.
Maybe they did consider all this and have a plan. But I havn't seen anyone write a "this is how you target arbitrary compositors with your toy screenshot program" article yet.
This is an odd application of that idea to me. In my experience it's not to terrible to punch holes in a system after the fact. Exceedingly difficult is patching the holes in a project that starts as Swiss cheese.
First of all, note that as with any window system, application buffers are not the final version of what you see on the screen. A normal desktop has wallpapers, transparency, task bars, multiple windows and window occlusion.
This means that apart from a few special cases, only the compositor knows how the full scene currently looks, and is the only entity capable of producing a buffer containing the entire thing.
For this reason, the only way to do screenshots is to have a way to ask the compositor for one. This is the case for any windowing system, and nothing related to buffer management will change that.
> ... that they didn't include a security policy mechanism for coordinating Wayland buffers
Depending on what you mean, this is either slightly or very untrue. Basically, when you try to present to screen, a client takes a buffer (which is private) and commits it to a surface. This temporarily borrows it to the server.
Should the server wish to share the buffer, this is when this would be done. Before doing so, the server would enforce any security restrictions as necessary. This is how all client-to-client communication happens in wayland: With the server as mediator, when it permits it.
A screenshot of a window or direct-scanout application could be implemented by simply having the server further borrow the buffer to a recording application, with appropriate restrictions in place.
> users really want applications to be able to snoop on each other when required.
I don't understand why you would think that this is a problem under Wayland. They only difference is that while X11 implicitly allows everyone to snoop on everything without any way to control it, snooping in Wayland is explicit, and servers can prompt users to permit it per application. Or not, it's up to the server.
This is not the intention under Wayland. Wayland protocol development is geared towards compositors implementing protocols for experimentation, and then basically "upstreaming" the result. Even before upstreaming, compositors share work (e.g. wlroots implemented at least one kde-specific protocol, that has now been superceeded by the resulting upstream work).
Also, all Wayland protocols are advertised in the registry, so applications don't do "I'm on KDE, so...", and instead just use the protocols available. It is therefore not a problem if KDE implements a GNOME protocol, for example. It'll just work.
Screenshot and recording will be a shared protocol, but due to wanting a proper protocol with goodies like damage tracking for performance, it's a little bit more work than you would think. We certainly don't want X's "dumb" approach—we want something faster and safer (that is, functionality guaranteed without tearing or fun stuff like that).
So we are going to reinvent X extensions from scratch? By the time that is finished we will have enough legacy bloat that people will call for the next replacement.
but, IMO, this is a good thing, and the only way it could have worked. if every single conceivable protocol was added to the initial specification, then wayland would never have been released. even if it was, people would complain even more about it being "bloated" and "non modular" and "not following the unix philosophy", whatever that means.
Windows switched to composited desktop with Vista in 2006 and didn't lose any[0] functionality. 14 years later and we're still saying "eventually" when discussing basic features Wayland should have.
[0] Technically it lost a few, the ability to ignore vsync for non-fullscreen applications being the biggest one.
Apart from stability.
Jokes aside, this has nothing to do with the protocol as much as the fact that there are vast differences in how an open source project is developed vs. how Microsoft develops.
A lot of Wayland development was initially funded by Samsung, which mainly focused on usecases for their smart devices. They then shut down their entire OSS department, so that workforce is out.
Now, finally redhat seems to be gearing up a bit, with GNOME Wayland being default on Fedora, and sponsoring Wayland work on things like Firefox.
But, even then, things are powered by what people want and care about, rather than just trying to tick every previous feature box available.