Pre-Shutdown Message
Currently in BeOS there does not exist a thorough method for shutdown notification and procedures. It is proposed a new standard message and response system be introduced. Additionally, mechanisms will be introduced to ensure needed services and applications remain open for use until dependant systems are closed.
Current System
When a shutdown occurs currently each application is sent a B_QUIT_REQUESTED message in order to terminate it. As this message does not indicate that it must quit in the near future or be killed the application may choose to ignore it, unaware of the impending shutdown.
If the application decides to quit at this point there could be problems with relying on other currently running applications in order to implement some feature used in the quit process. Thus, there could exist some scenarios where the dependency breaks when one of the applications depended upon quits before the first has a chance to handle the quit message themselves. e.g. an application may rely on functionality of Tracker or Deskbar in order to save an object.
Details
In order to prepare all applications for an upcoming shutdown it is proposed that a new message be introduced which is used to notify applications of the approximate shutdown time. This would enable all applications to have sufficient time to save all data and settings without incident.
Immediately before the shutdown is finally carried out a second message should be passed to all applications to ensure they are ready for the event. If an application is unready it should send a response accordingly. In this way the system will not inadvertently shutdown an application needing user intervention.
It would be possible to present the user with a list of running applications and the state of readiness they report when shutdown time arrives. This would continue the idea of allowing unresponsive applications to be 'force quit' but would allow for some idea of readiness of the application in question.
The period of time between the two messages should be used in order to ensure all data is saved and all actions depending on other services finalised.
Issues
- Should there be some mechanism to ensure needed apps kept up? Hard coded? This was referenced in the original thread but never solved adequately.