weird session problem



yes, I know the following code is C++ but it is very easy to translate it
to C code.

I'm using the following code to save my state:

    Gnome::Client* session_client = Gnome::Client::master_client ();
    if (session_client)
    {
	session_client->die.connect (SigC::slot(this, &Main::session_die_cb));
	session_client->save_yourself.connect (SigC::slot(this, &Main::session_save_cb));
    }

then in session_save_cb:

    Gnome::Client* session_client = Gnome::Client::master_client ();
    if (session_client)
    {
	vector<string> argv;
	argv.push_back (cmd_self);
	argv.push_back (last_filename);

	session_client->set_clone_command (argv);
	session_client->set_restart_command (argv);
    }

however, this only works after the second time the session is saved. I.e.
if I start my session, then save it, ~/.gnome/session will not contain the
modified command line. If I save it again, it works (and it works for all
subsequent saves as well).
The code inside "if (session_client) {}" is run at the first save as well
(I've tested with printing out argv[0] and argv[1] from it).

Any idea what I'm doing wrong?

-- 
   .--= ULLA! =---------------------.   `We are not here to give users what
   \     http://cactus.rulez.org     \   they want'  -- RMS, at GUADEC 2001
    `---= cactus cactus rulez org =---'
A focit 11 jó játékos és a hazai csapat játsza.





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