[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Session restoration and autostart
From:       David Jarvie <lists () astrojar ! org ! uk>
Date:       2005-09-09 20:00:14
Message-ID: 200509092100.14856.lists () astrojar ! org ! uk
[Download RAW message or body]

On Thursday 08 Sep 2005 13:34, Lubos Lunak wrote:
>  I've already said it, and I will repeat it: Sessions and autostart are not
> meant to be used together. Use either one or the other one, not both. If
> you
> use sessions, just handle saving and restoring of the data, the system will
> take care of everything else. If you want to use autostart for some reason,
> take care of everything yourself. End of story. Why would you need both?

For one thing, to avoid reinventing the wheel. I don't particularly want to 
write window restoring code when session restoration could take care of it 
for me. But I definitely have to use autostart.

>  If I'm not mistaken, you just use session saving for storing window
> positions. So either just use session saving (boy, do I hate all those "are
> you really really sure you don't want this app next time?" dialogs), or
> just use autostart if you want it that way for some reason and save the
> positions yourself.

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.

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?

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/linux/kalarm.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic