After reading Save and restore may be coming to GNOME [LWN.net] I have some general comments.
I may be wrong, but it seems that the Save and Restore feature comes as a single “package” with a top-level requirement. But I see in it different problems that can be independently solved:
- Being able to position top-level windows on Wayland. Not only for restoring the state, but also to allow a multi-process architecture.
My typical example is Vim in a terminal launching a Devhelp assistant window that should be positioned above or below the Vim cursor.
I think that some big apps also use this multi-process architecture (with several top-level windows living as separate programs) and currently rely on X11 to work. - Being able to save and restore the content: what is inside the windows.
- Being informed for the app about the way it was last closed (notably, if there was an app or session crash).
I don’t pretend to know everything about this problem space. But in general, I think it’s a good practice to separate the mechanism from the policy. The mechanism is at a lower-level: you solve different problems “mechanically”. Then there is a higher-level policy solution, more subject to changes over time (solving the more specific top-level requirement for Save and Restore in GNOME).