Screen Recorder for Wayland?

quote from the SSR dev to my recent reply on his github.

Are any of the major distributions shipping with Wayland as default, or even as the only option?

I've had long discussions with the Wayland developers years ago about implementing screen capturing, global hotkeys, absolute positioning and other protocol features which they are still lacking. They aren't particularly enthusiastic about the idea, and the discussions got nowhere. They seem to feel that applications shouldn't actually need any of these features, therefore these features should not be used, and therefore implementing them is a bad idea. Someone has tried before to submit patches that allow absolute positioning - they got rejected. I'm pretty sure that the same thing would happen if I tried to submit patches that would allow screen capturing. The developers simply don't want these features.

They also had some legitimate but rather inconsistent/nonsensical security concerns. They were (rightly) worried that such a protocol feature could be abused to create keyloggers and other spyware, but at the same time they ignored that, at least under the current Linux permissions model, these keyloggers are already possible by other means. So obviously refusing to implement these features does not actually improve security. Some people simply refused to believe that this was a problem, so at that time I wrote my proof-of-concept Wayland keylogger.

I proposed that we should add these features now, and later, when a desktop environment with sandboxing capabilities actually shows up, simply disable those features for applications that don't have permissions to use them. Pretty much like Android does it. They didn't like that idea. They wanted something that was 'as secure as possible' even without sandboxing. I feel that this is a nonsensical stance since I had just proven that under their current model, security is not possible, so their nag screens asking the user to grant the application screen casting permissions would just be a nuisance that doesn't actually improve security - security theater, basically.

Since the entire discussion about security policy clearly wasn't getting anywhere, the developers decided to move all the policy-related stuff into 'Wayland Security Modules', which is pretty much the Wayland equivalent of 'Linux Security Modules' for the kernel. It means you can integrate Wayland with the security system of your choice without making Wayland dependent on that security system. It's a really good idea but it was also a lot of work. I was interested in writing screen capturing software, not dealing with security policies, so I decided to wait until the developers had decided how they wanted to handle their security, and meanwhile I just focused on SSR for X11 and OpenGL.

This was three years ago, and I haven't really been following Wayland development since then. AFAIK there is still no standardized screen capture interface, but it seems that the KDE people are now dealing with the same problem related to screenshots. It's still not a standardized solution and it's still not suitable for screen capture, but at least there is some progress.

For the time being, I think the most realistic option for me is to add Wayland capturing capabilities to GLInject. This is technically the ugly option but it doesn't require any permission or collaboration from the Wayland, GNOME, or KDE developers, and it will work for any application and any desktop environment. It's still a lot of work though, and I'm working on a number of other projects now instead of SSR. Since the number of people that run Wayland is still extremely small, it's not a high priority for me.

tldr; FUCK WAYLAND.

Time to go to Gentoo.

1 Like