summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Rocha <lucasr@gnome.org>2007-11-18 23:48:23 +0000
committerLucas Almeida Rocha <lucasr@src.gnome.org>2007-11-18 23:48:23 +0000
commit20d599819b32d9c8bda1cad468664e6c1ff0a902 (patch)
treed3ef40433bd46bd783246f121fd593ce6d1a147b
parenta8583668eb9bb40e2459c1ede07cf6b4f829022f (diff)
downloadmetacity-20d599819b32d9c8bda1cad468664e6c1ff0a902.tar.gz
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
-rw-r--r--ChangeLog6
-rw-r--r--src/main.c17
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f4c7a687..67bdc551 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/src/main.c b/src/main.c
index e46cac12..8319fba7 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.
*/