A Screensaver Interface Comes To Wayland
Pekka Paalanen has proposed a screensaver interface for Wayland, which includes adding the interface to the protocol file, compositor stubs, and other changes.
Details and the patch for Wayland screensaver can be found in this mailing list message. Below is also a description of the work. Pardon for the terse posting due to needing to go meet-up with Egbert Eich of SUSE/RadeonHD, Martin Gräßlin of KDE/KWin, and other Linux stakeholders.
Add the screensaver interface to the desktop-shell protocol file. Also add stubs for it in the compositor, and make wscreensaver to bind to the screensaver interface. Wscreensaver gets a new option --demo to retain the current behaviour as a regular wayland client.
When a screensaver application starts, it should bind to the screensaver interface, enumerate all outputs, create a surface per output, and register those surfaces via screensaver::set_surface request. Then it continues with the usual animation loop, waiting for frame events. The compositor will decide, when the given screensaver surfaces are displayed. A screensaver application should respond to outputs coming and going away by creating and destroying surfaces.
The compositor is supposed to activate a screensaver by exec'ing it, and stop the screensaver by killing the client process. Only one client may be bound to the screensaver interface at a time. If there already is a client, the compositor could either kill it first, or not exec a new one.