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

List:       kde-devel
Subject:    Re: Session restoration problem in KDE 3.1
From:       David Jarvie <lists () astrojar ! org ! uk>
Date:       2002-08-29 19:05:17
[Download RAW message or body]

On Thursday 29 Aug 2002 4:38 am, Waldo Bastian wrote:
> On Wednesday 28 August 2002 04:44 pm, David Jarvie wrote:
> > My application's session restoration doesn't work in KDE 3.1beta1. It
> > used to work fine in KDE 3.0.x. (I have fixed an earlier glitch with
> > saving its session file in KDE 3.1beta1 - an old session file existed,
> > but was never replaced until I manually deleted it - very peculiar!!).
> >
> > The application has two KMainWindow derived classes. I have put debug
> > output into the session restoration loop in newInstance(), and it only
> > processes one main window instead of the two which were saved at logout
> > (in the example below), and the class name of the first window is found to 
> > be blank. Any ideas on what is going wrong would be appreciated.
>
> It looks like your session config file has disappeared already somehow.
>
> All applications I have seen so far do session restoration from main()
> instead of from newInstance(), does it help if you do that?

Yes, I tried the session restoration before kapp->exec() is called, and it 
fixes the problem. Thanks, Waldo. :)

I think that it would be useful for some comments be added to the kdelibs 
header files to warn people about this, in the hope that others won't waste 
the hours which I have spent on these problems. The question is, where? It is 
a KUniqueApplication issue, but the main description of session management is 
in KMainWindow, while isRestored() is in KApplication. I would like to see a 
warning in both the KApplication::isRestored() description, and in 
KMainWindow::canBeRestored() against using these methods in 
KUniqueApplication::newInstance(). Or perhaps the warning could be put in 
KUniqueApplication::newInstance(), but I fear that it might not be noticed 
there when people are searching for information on session management.

Waldo - it also seems to lessen the number of times that autostart phase 2 
invocations slip in before session restoration invocations, but unfortunately 
it doesn't seem to cure that completely. I will investigate further, as 
requested.

-- 
David Jarvie
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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