Close openbox.log when restarting
[dana/openbox.git] / openbox / openbox.c
index 3f28609..e71465a 100644 (file)
@@ -417,6 +417,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 +471,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;
 }
@@ -529,7 +531,7 @@ static void print_help(void)
     g_print(_("  --sync              Run in synchronous mode\n"));
     g_print(_("  --debug             Display debugging output\n"));
     g_print(_("  --debug-focus       Display debugging output for focus handling\n"));
-    g_print(_("  --debug-session     Display debugging output for session managment\n"));
+    g_print(_("  --debug-session     Display debugging output for session management\n"));
     g_print(_("  --debug-xinerama    Split the display into fake xinerama screens\n"));
     g_print(_("\nPlease report bugs at %s\n"), PACKAGE_BUGREPORT);
 }
@@ -580,13 +582,9 @@ static void parse_args(gint *argc, gchar **argv)
             ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE);
         }
         else if (!strcmp(argv[i], "--debug-focus")) {
-            ob_debug_enable(OB_DEBUG_NORMAL, TRUE);
-            ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE);
             ob_debug_enable(OB_DEBUG_FOCUS, TRUE);
         }
         else if (!strcmp(argv[i], "--debug-session")) {
-            ob_debug_enable(OB_DEBUG_NORMAL, TRUE);
-            ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE);
             ob_debug_enable(OB_DEBUG_SM, TRUE);
         }
         else if (!strcmp(argv[i], "--debug-xinerama")) {
@@ -609,7 +607,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")) {