Re: Session management stuff

Moin moin,

>>>>> "Tom" == Tom Tromey <> writes:

    Tom> I think this is the wrong thing to do.  The --display option
    Tom> is one that you particularly *do not* want to save.  Saving
    Tom> it means that your session will require a particular display
    Tom> in order to run.  Instead, sessions should be
    Tom> display-independent.  In general programs should use the
    Tom> display passed in via the DISPLAY environment variable.  This
    Tom> will let you log out on one machine, log in on another, and
    Tom> see your same saved session.  I think this capability is very
    Tom> important in some environments (for instance, university
    Tom> labs).

But not saving the --display option is also incorrect.  Suppose
somebody is having a multihead environment and wants one special gnome 
program to be restarted on his second display.  Because this problem
is existing in actually every gnome application, this should be solved 
in the gnome libraries.  So this can probably be solved by adding a
new command line option to the session management stuff - I'll think
about it.  The same applies for the DISPLAY environment variable.

    Tom> I've changed gnome-session to set DISPLAY in the environment
    Tom> before loading any sessions.

I don't know, if this is really a god idea.  Assume that I have a
display A.  If I call a program with the '--display B' command line
option, I assume, that only this program will have it's display on B
and all called program open their display on A again.  Setting the
DISPLAY environment variable to B lets the program and all called
program use display B.  So gnome-session should only set the DISPLAY
environment variable if it is unset before.  But that's probably a
behaviour that's not to important.

    Tom> I've changed gnome-session to save and restore the
    Tom> environment.  (I haven't tested it yet, though.)  The
    Tom> restored environment is first merged with gnome-sessions'
    Tom> environment before execing the child.

Sounds good.

    Tom> However, gnome-client.c currently saves the DISPLAY
    Tom> environment variable.  This is the wrong thing to do.  I
    Tom> notice that it also saves HOME, PATH, and LD_LIBRARY_PATH.  I
    Tom> think all of these are actually harmful to save.  Suppose the
    Tom> user's home directory changes?  Then his saved session will
    Tom> be bad.  Suppose he installs a new program and adds a
    Tom> directory to his PATH?  Oops, the panel in the session won't
    Tom> find it, because it's PATH value is fixed.

Ups, you are right.  HOME, PATH and LD_LIBRARY_PATH shouldn't really be 
saved.  They have only been there for testing purpose.  Looks like I
unfortunately forgot the remove them before committing the code... sorry.

Tschuess, Carsten

Carsten Schaar                         email:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]