]> Dogcows Code - chaz/openbox/blobdiff - openbox/openbox.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / openbox.c
index d6e87d94802ad750ef67cd4bd37fb7be6649c97e..29506c00b74b681b671a65b7502450e3781a6c1a 100644 (file)
@@ -42,7 +42,6 @@
 #include "config.h"
 #include "ping.h"
 #include "prompt.h"
-#include "hooks.h"
 #include "gettext.h"
 #include "render/render.h"
 #include "render/theme.h"
@@ -235,7 +234,6 @@ gint main(gint argc, gchar **argv)
 
                 /* register all the available actions */
                 actions_startup(reconfigure);
-                hooks_startup(reconfigure);
                 /* start up config which sets up with the parser */
                 config_startup(i);
 
@@ -401,7 +399,6 @@ gint main(gint argc, gchar **argv)
             sn_shutdown(reconfigure);
             event_shutdown(reconfigure);
             config_shutdown();
-            hooks_shutdown(reconfigure);
             actions_shutdown(reconfigure);
         } while (reconfigure);
     }
@@ -417,6 +414,7 @@ gint main(gint argc, gchar **argv)
     obt_display_close();
 
     if (restart) {
+        ob_debug_shutdown();
         if (restart_path != NULL) {
             gint argcp;
             gchar **argvp;
@@ -470,7 +468,8 @@ gint main(gint argc, gchar **argv)
     g_free(ob_sm_id);
     g_free(program_name);
 
-    ob_debug_shutdown();
+    if (!restart)
+        ob_debug_shutdown();
 
     return exitcode;
 }
@@ -547,8 +546,21 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num)
 
 static void parse_env(void)
 {
+    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)
@@ -605,7 +617,7 @@ static void parse_args(gint *argc, gchar **argv)
                    what we want */
                 config_file = argv[i+1];
                 ++i; /* skip the argument */
-                ob_debug("--config-file %s\n", config_file);
+                ob_debug("--config-file %s", config_file);
             }
         }
         else if (!strcmp(argv[i], "--sm-save-file")) {
@@ -662,7 +674,7 @@ static Cursor load_cursor(const gchar *name, guint fontval)
 
 void ob_exit_with_error(const gchar *msg)
 {
-    g_message(msg);
+    g_message("%s", msg);
     session_shutdown(TRUE);
     exit(EXIT_FAILURE);
 }
This page took 0.024618 seconds and 4 git commands to generate.