diff --git a/ChangeLog b/ChangeLog index f4c7a6879..67bdc5519 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-11-19 Lucas Rocha + + * 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 * configure.in: Post-release bump to 2.21.3. diff --git a/src/main.c b/src/main.c index e46cac129..8319fba7c 100644 --- a/src/main.c +++ b/src/main.c @@ -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. */