From kde-core-devel Fri Sep 02 11:09:12 2005 From: Waldo Bastian Date: Fri, 02 Sep 2005 11:09:12 +0000 To: kde-core-devel Subject: Re: Session restoration and autostart Message-Id: <200509021309.16355.bastian () kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=112565946129696 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1547953.LtK5bBvVnC" --nextPart1547953.LtK5bBvVnC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 30 August 2005 23:34, David Jarvie wrote: > Currently, session restoration and autostart are not compatible for a > KUniqueApplication, since there is no guarantee that the application will > be activated by session restoration before it is autostarted. If it is > activated by session restoration after it has been autostarted, it cannot > detect that it is supposed to restore the session. > > Although in general applications only need to use one or other of these > facilities, there can be a need to use both - as in the case of kalarm. It > needs to ensure that it is started in the system tray at login, regardless > of whether the session is being restored or whether it was still running at > logout. But it is also desirable that it should act in the same was as any > other KDE application when the session is restored, i.e. that any of its > main windows are restored if they were visible at logout. > > I can see a few ways of addressing this problem, where an application is > configured to be both restored and autostarted. In decreasing order of > preference for the application developer: > > 1) Provide a means to guarantee that autostart will only occur once the > application has been restored (if it actually is scheduled to be restored). > This would allow the application to be configured to use both methods > without having to take any special precautions. That's what we have the different autostart phases for already. > 2) When the application is activated to restore the session, provide a > means for it to detect that it is being restored so that it can take the > appropriate action. KApplication::isRestored() provides that information. > 3) Use another autostarted task to "auto"start the application. That task > would allow an arbitrary period of time to elapse, in the hope that session > restoration will have occurred, before starting the application. (But of > course, what is a safe length of time?) Or alternatively, if that task was > provided with the means to detect whether the application was scheduled for > session restoration, it could then know whether it actually needed to start > the application or not. > > I don't know what the practicalities are of addressing this issue - I'm > willing to spend some time on it given some guidance. Cheers, Waldo --nextPart1547953.LtK5bBvVnC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBDGDLcN4pvrENfboIRAg9BAJ4trvZk0m+sxMGe+jOVN1o5LqeUWQCfTx8C /ej1nMi/Gfk+5yaF1kOXHdY= =mRxW -----END PGP SIGNATURE----- --nextPart1547953.LtK5bBvVnC--