Implement XDG session management wayland protocol
Implement the XDG session management protocol, in order to allow clients to ask the compositor to save window state for them. This works via creating a xdg_session_v1 object that lets the client obtain a session ID to persistently identify the client's session on future executions. This object may also be used to register xdg_toplevels with a specific name, so that their state is tracked and remembered.
Underneath this is implemented as a Gvdb file at ~/.local/share
to store the state of all client sessions, and allowing reasonably fast access to each of them, even though there is no support for X11 applications, the per-window details that are saved are specified in a windowing-specific manner.
The protocol is still under discussion so this MR is Draft
, however it also has some caveats/TODOs:
- Loading/saving the GVDB file is ATM fully synchronous.
- Saving the file only happens on clean exit of the compositor process. There is some incipient code to preserve a FD in systemd's fdstore, so we might theoretically have something fancier to incrementally/asynchronously flush changes to it, but that's not fully fleshed out yet.
- We should have some limits, or eviction policies of this cache, right now every session will be remembered.
- We might want to save more window state than there currently is
- Of course, more tests are welcome