On 5/11/06, Nicolas Roard <[EMAIL PROTECTED]> wrote:
On 5/10/06, Yen-Ju Chen <[EMAIL PROTECTED]> wrote:
> I just explain more on the x session manager.
> When users logout, session manager will ask each application to save
> their own state, even the window position.
> Each application will return a command to session manager so that
> session manager can start this application again next time.
> For example, Ink.app might return a command
> 'openapp Ink.app --load ~/file.txt -line 24'
> The next time, session simply execute this command.
> Therefore, applications take FULL responsibility to reload itself.
Partly agree -- I think GNUstep/Etoile apps should returns a NSData
(which thus can be anything) rather than a simple command line,
because that will be much more flexible.
I am not saying that is what we should do.
I just said that is what xwindow do. :)
The return command to session manager is for session manager to load
the application.
So actually in most case, like gnome-terminal,
the return command is 'gnome-terminal --session saved-session-xxxxx'.
And this 'saved-session-xxxx' file contains all the information
you want to have in the NSData you mentions above.
Session manager don't know what's in this file (NSData).
It simply calls the exact command 'gnome-terminal --session
saved-session-xxxx'.
gnome-terminal is responsible to load this 'saved-session-xxx' and
read the NSData inside.
If you called this command in terminal, you will get the same effect.
Therefore, there is no need to return the NSData to session manager.
And every applictaion has its own way to save its session.
Firefox may return 'firefox -open http://this.web.site'
and session manager will simply call it next time.
As long as it tells session manager how to execute the commands of
applications,
the application will load its session based on the command it returns.
And applications are responsible to manager these saved-session-xxxx files.
We'll then simply save this NSData in the proper file in the hidden
directory, and start the applications passing this file as parameter,
etc.
We can have some frameworks to facilitate this process,
just like NSUserDefaults, but project-specific,
or allows multiple defaults.
There is a session id involved in session management of x window.
So they won't get confused.
[snip]
> Actually GNUstep already did some of these functions.
> The position of menu is automatically saved and loaded.
> Window and view can be saved if developers ask for.
Yes and no -- I mentionned it in my mail: yes GNUstep save those
informations, but it (obviously) don't save them per-project, only
per-application. Works well if you don't have projects, but won't work
if you have projects :-)
In x window, all the applications in each session
will return the commands to session manager.
So session manager know which applications is in this session,
and it will load them one-by-one with some priorities.
Therefore, it is the responsibity of session manager to know which application
belongs to which project (session).
Application doesn't know it is in which project (session).
For example, when session manager try to save session 1,
Ink.app may return 'openapp Ink.app ThisFile.rtf',
and for session 2, Ink.app may return 'openapp Ink.app ThatFile.txt'.
When session manager try to load session 2,
it will execute the command 'openapp Ink.app ThatFile.txt'
and Ink.app will open the file 'ThatFile.txt'
Yen-Ju
Still, the modification should be straightforward: instead of saving
the informations in the defaults, we'll save them in a file in the
hidden directory of the associated project.
> So it all depends on applications themself.
> Session manager simply provide a place and protocol to save and load
> the commands.
Yes, I agree with that.
--
Nicolas Roard
"I love deadlines. I like the whooshing sound they make as they fly
by." -- Douglas Adams
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss