try to get the session client ID from DESKTOP_AUTOSTART_ID environment

2007-11-19  Lucas Rocha  <lucasr@gnome.org>

	* src/main.c (main): try to get the session client ID from 
	DESKTOP_AUTOSTART_ID environment variable in case the --sm-client-id 
	is not used. Closes #498033.

svn path=/trunk/; revision=3415
This commit is contained in:
Lucas Rocha 2007-11-18 23:48:23 +00:00 committed by Lucas Almeida Rocha
parent a8583668eb
commit 20d599819b
2 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-11-19 Lucas Rocha <lucasr@gnome.org>
* src/main.c (main): try to get the session client ID from
DESKTOP_AUTOSTART_ID environment variable in case the --sm-client-id
is not used. Closes #498033.
2007-11-17 Thomas Thurman <thomas@thurman.org.uk>
* configure.in: Post-release bump to 2.21.3.

View File

@ -382,8 +382,23 @@ main (int argc, char **argv)
* info
*/
if (!meta_args.disable_sm)
meta_session_init (meta_args.client_id, meta_args.save_file);
{
if (meta_args.client_id == NULL)
{
const gchar *desktop_autostart_id;
desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID");
if (desktop_autostart_id != NULL)
meta_args.client_id = g_strdup (desktop_autostart_id);
}
/* Unset DESKTOP_AUTOSTART_ID in order to avoid child processes to
* use the same client id. */
g_unsetenv ("DESKTOP_AUTOSTART_ID");
meta_session_init (meta_args.client_id, meta_args.save_file);
}
/* Free memory possibly allocated by the argument parsing which are
* no longer needed.
*/