diff options
author | Matthias Clasen <mclasen@redhat.com> | 2011-04-29 07:23:30 -0400 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2011-05-25 15:39:23 -0400 |
commit | bbfcde1caa8a3795965ed611834860a9fb7566eb (patch) | |
tree | 4d40cf1cb5524aad6c8edeae67c8c005b2b17ce9 | |
parent | 31e6cdf345c87eb8c28ca4b82c69d693963605bf (diff) | |
download | mutter-bbfcde1caa8a3795965ed611834860a9fb7566eb.tar.gz |
Make session saving work a bit better
Previously, the restart command hardcoded "mutter" as the binary name.
This commit changes it to use g_get_prgname() which has a better chance
of being correct (and it does fix session saving for gnome-shell).
Now that mutter is a library, it might be more correct (but also
much higher overhead) to add api for setting these things from
the outside.
https://bugzilla.gnome.org/show_bug.cgi?id=648828
-rw-r--r-- | src/core/session.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/session.c b/src/core/session.c index 65542f39d..c19b17c7b 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -308,13 +308,16 @@ meta_session_init (const char *previous_client_id, */ char hint = SmRestartIfRunning; char priority = 20; /* low to run before other apps */ - + const char *prgname; + + prgname = g_get_prgname (); + prop1.name = SmProgram; prop1.type = SmARRAY8; prop1.num_vals = 1; prop1.vals = &prop1val; - prop1val.value = "mutter"; - prop1val.length = strlen ("mutter"); + prop1val.value = (char *)prgname; + prop1val.length = strlen (prgname); /* twm sets getuid() for this, but the SM spec plainly * says pw_name, twm is on crack @@ -573,6 +576,9 @@ set_clone_restart_commands (void) char *discardv[10]; int i; SmProp prop1, prop2, prop3, *props[3]; + const char *prgname; + + prgname = g_get_prgname (); /* Restart (use same client ID) */ @@ -582,7 +588,7 @@ set_clone_restart_commands (void) g_return_if_fail (client_id); i = 0; - restartv[i] = "mutter"; + restartv[i] = (char *)prgname; ++i; restartv[i] = "--sm-client-id"; ++i; @@ -603,7 +609,7 @@ set_clone_restart_commands (void) /* Clone (no client ID) */ i = 0; - clonev[i] = "mutter"; + clonev[i] = (char *)prgname; ++i; clonev[i] = NULL; |