As a minor aside, it would be desirable to do as much work as possible between SaveYourselfCB() and SmcSaveYourselfDone(), and as little as possible between DieCB() and SmcCloseConnection().
At least in KDE, the time-out for the first phase is slightly longer (15 seconds and configurable versus 10 seconds and not configurable IIRC)
But probably the convolutions required to accomplish this aren't worth it.
As a minor aside, it would be desirable to do as much work as possible between SaveYourselfCB() and SmcSaveYourself Done(), and as little as possible between DieCB() and SmcCloseConnect ion().
At least in KDE, the time-out for the first phase is slightly longer (15 seconds and configurable versus 10 seconds and not configurable IIRC)
But probably the convolutions required to accomplish this aren't worth it.