Merge branch 'backport' into work
[dana/openbox.git] / openbox / openbox.c
index d6da5ec..291b694 100644 (file)
@@ -128,6 +128,10 @@ gint main(gint argc, gchar **argv)
     bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
     textdomain(PACKAGE_NAME);
 
+    if (chdir(g_get_home_dir()) == -1)
+        g_message(_("Unable to change to home directory \"%s\": %s"),
+                  g_get_home_dir(), g_strerror(errno));
+
     /* parse the command line args, which can change the argv[0] */
     parse_args(&argc, argv);
     /* parse the environment variables */
@@ -148,7 +152,7 @@ gint main(gint argc, gchar **argv)
          * remote_control = 2 -> restart */
         OBT_PROP_MSG(ob_screen, obt_root(ob_screen),
                      OB_CONTROL, remote_control, 0, 0, 0, 0);
-        obt_display_close(obt_display);
+        obt_display_close();
         exit(EXIT_SUCCESS);
     }
 
@@ -384,7 +388,7 @@ gint main(gint argc, gchar **argv)
 
     session_shutdown(being_replaced);
 
-    obt_display_close(obt_display);
+    obt_display_close();
 
     if (restart) {
         if (restart_path != NULL) {
@@ -398,7 +402,7 @@ gint main(gint argc, gchar **argv)
                 g_strfreev(argvp);
             } else {
                 g_message(
-                    _("Restart failed to execute new executable '%s': %s"),
+                    _("Restart failed to execute new executable \"%s\": %s"),
                     restart_path, err->message);
                 g_error_free(err);
             }
@@ -613,7 +617,7 @@ static void parse_args(gint *argc, gchar **argv)
         else {
             /* this is a memleak.. oh well.. heh */
             gchar *err = g_strdup_printf
-                (_("Invalid command line argument '%s'\n"), argv[i]);
+                (_("Invalid command line argument \"%s\"\n"), argv[i]);
             ob_exit_with_error(err);
         }
     }