Session restoration and autostart

David Jarvie lists at astrojar.org.uk
Tue Sep 13 22:25:34 BST 2005


On Monday 12 Sep 2005 14:40, Lubos Lunak wrote:
> On Friday 09 of September 2005 22:00, David Jarvie wrote:
> > I wonder how many developers have fallen foul of the rule that you can't
> > use autostart and session restoration together? It isn't obvious that the
> > rule exists unless you happen to have read the right stuff in the mailing
> > lists. I for one have spent quite a bit of time trying to sort out bugs
> > arising from this over the past 2 or 3 years, and I suspect from his
> > comments that Christian Esken may have too. And no doubt we're not the
> > only
> > ones. Either there should be big warnings in the documentation (which
> > hopefully people might eventually spot), or preferably autostart and
> > session restoration should be made compatible.
>
>  There's no rule. They simply doesn't work well together because they're
> different concepts. Session is something like a snapshot of the desktop.
> During session saving applications are saving all their state to session
> files and it should be possible to restore exactly that state just from the
> saved session data. Logout is not just one action but actually two phases,
> session saving and shutdown. The same way it should be possible to save the
> state anytime, for crash recovery or whatever. And during KDE start you
> could
> be presented with a list of sessions to restore. Autostart is just plain
> start-it-during-every-KDE-startup. How would you want to combine two sets
> of data, one coming from autostart (which comes from who knows where) and
> another coming from a "random" session? In fact autostart shouldn't exist
> at all and everything launched should be just part of the session. And the
> nitpicking optimization guy in me isn't quite happy with the double
> launching of the application.
>
>  Ok, so much for the theory. In practice it's not so, because those
> features
> are not implemented in ksmserver, and SM support in most apps is pretty
> broken, probably because people don't really get this sessions thing. And
> autostart seems to be much simpler to understand.
>
>  Either way, how exactly would you want those two work together? And, while
> I'm at it, why do you definitely need autostart?

I need to ensure that kalarm starts in the system tray at login, so that 
alarms are enabled. But I also want to restore any visible windows, to make 
it act like a normal session-restored program.

> > How about simply making KApplication::isRestored() return true during a
> > session manager activation, even if the program was already running
> > before that? Would that work?
>
>  Technically, yes, it'd mean adding similar code like there's already for
> startup notification ('asn'). In practice ... I have no idea *shrug*.

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html




More information about the kde-core-devel mailing list