[mutter] Make session saving work a bit better



commit c248c57b6e48b230fc80e3bd53d0d41fb713848a
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 29 07:23:30 2011 -0400

    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

 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 65542f3..c19b17c 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;
 



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