]> Dogcows Code - chaz/openbox/commitdiff
Get the session client id from new gnome-session
authorDana Jansens <danakj@orodu.net>
Thu, 10 Dec 2009 20:00:56 +0000 (15:00 -0500)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Dec 2009 20:00:56 +0000 (15:00 -0500)
See http://live.gnome.org/SessionManagement/GnomeSession#A1._Launch

Gnome-session sets the DESKTOP_AUTOSTART_ID env variable with the SM client id
instead of passing it on the command line.

openbox/openbox.c

index 4a49c8021086153ea43602024f15dbf190a324e3..60e147c357eeee55a304a0db3f81905e45049184 100644 (file)
@@ -561,8 +561,21 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num)
 
 static void parse_env()
 {
+    const gchar *id;
+
     /* unset this so we don't pass it on unknowingly */
     unsetenv("DESKTOP_STARTUP_ID");
+
+    /* this is how gnome-session passes in a session client id */
+    id = g_getenv("DESKTOP_AUTOSTART_ID");
+    if (id) {
+        unsetenv("DESKTOP_AUTOSTART_ID");
+        if (ob_sm_id) g_free(ob_sm_id);
+        ob_sm_id = g_strdup(id);
+        ob_debug_type(OB_DEBUG_SM,
+                      "DESKTOP_AUTOSTART_ID %s supercedes --sm-client-id\n",
+                      ob_sm_id);
+    }
 }
 
 static void parse_args(gint *argc, gchar **argv)
This page took 0.023033 seconds and 4 git commands to generate.