State Save
Additional methods should be added to all applications which would act to save the current state of each application. All relevant information including (for example) current document edits, window positions and data stream positions should be saved in a standardised way. This would enable easy save, hibernate and start functionality.
Details
Single Application
Each application should have the ability to save its state at any instant to a predefined file. This snapshot style file could be used during application startup to restore the previous session's state in a standardised manner. More importantly it would allow more useful coordinated loading/saving algorithms (See Global State).
Information saved would include items such as:
- Data stream information
- Window locations, sizes
- Widget states, contained data
Triggering the save could be achieved through additional hooks in BApplication. Return codes would indicate the level of success.
Global State
There is the possibility for state saves to be triggered automatically by the operating system at certain points, including:
- Shutdown
- Log off
Additionally sets of applications, sessions, could be loaded at points such as system startup. Interesting sets of applications include:
- Those running at last shutdown
- Predefined work modes
- 'At Work'
- 'At Home'
- Special constant set for startup
Using the 'previous shutdown' session we would automatically have a hibernate option. Note that there should be a mechanism to bypass the state save and, for example, have a 'real shutdown' command (potentially in a hidden place like CTRL-ALT-DEL).
Security / Stability
State files require extra attention from security perspective. They allow an extra entry mechanism for malware, virii and other dubious software. It would be a convenient mechanism for such software to load each boot.
Care must be taken to save a valid and usable state each time. If a system critical application saved an invalid state, or a state in which a crash is inevitable, the state becomes unusable. Supposing this application is set to automatically load from the state the system would require a mechanism for a 'clean' boot or 'clean' loading of applications (This was evident in OS/2 with the saving of unstable system states causing continual rebooting).
Issues
- Some things such as streaming data are once only occurrences. How do we save state there?

Comments
Re: State Save
This is interesting. So to save an application state, would there be another gadget like close, but it's "close saving state"? (Or maybe clicking close while holding down a certain key?)
And I guess there would be a shutdown option "shutdown saving state" (or maybe that's the default if you shut down with applications still running). I assume then the currently running applications would also have to have their individual states saved at that time.
I think if an application does not respond during shutdown, it should be killed and removed from the state. (...oh, but that sounds like a federal crime ;)
If this saving state scheme is too complicated to implement, I'd still like to see window size and position "snapshot" implemented (which should be much easier because it doesn't involve application data). I really want there to be a "snapshot window" gadget on all windows. Clicking the "snapshot" gadget will save that window's current size and position. It will then always open the way you want it. It's a pain having to move/resize windows every time if it defaults to a stupid size or position. (Non-sizeable windows would just save position.)