X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fopenbox.c;h=4703d7d6eb921632f203416eda9ead477f689a17;hb=d35605823736410c4910ec1affe9563e4e8a8769;hp=1b39b40478b2a03cc387a4e12966f5e9069aa453;hpb=bcc31faf7ecd8b0ad3b66a75fc72145e93e6c35a;p=chaz%2Fopenbox diff --git a/openbox/openbox.c b/openbox/openbox.c index 1b39b404..4703d7d6 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -91,6 +91,7 @@ gchar *ob_sm_id = NULL; gchar *ob_sm_save_file = NULL; gboolean ob_sm_restore = TRUE; gboolean ob_debug_xinerama = FALSE; +const gchar *ob_locale_msg = NULL; static ObState state; static gboolean xsync = FALSE; @@ -109,6 +110,7 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num); static void parse_env(); static void parse_args(gint *argc, gchar **argv); static Cursor load_cursor(const gchar *name, guint fontval); +static void run_startup_cmd(void); gint main(gint argc, gchar **argv) { @@ -119,6 +121,8 @@ gint main(gint argc, gchar **argv) ob_debug_startup(); /* initialize the locale */ + if (!(ob_locale_msg = setlocale(LC_MESSAGES, ""))) + g_message("Couldn't set messages locale category from environment."); if (!setlocale(LC_ALL, "")) g_message("Couldn't set locale from environment."); bindtextdomain(PACKAGE_NAME, LOCALEDIR); @@ -343,28 +347,7 @@ gint main(gint argc, gchar **argv) ob_set_state(OB_STATE_RUNNING); - if (startup_cmd) { - gchar **argv = NULL; - GError *e = NULL; - gboolean ok; - - if (!g_shell_parse_argv(startup_cmd, NULL, &argv, &e)) { - g_message("Error parsing startup command: %s", - e->message); - g_error_free(e); - e = NULL; - } - ok = g_spawn_async(NULL, argv, NULL, - G_SPAWN_SEARCH_PATH | - G_SPAWN_DO_NOT_REAP_CHILD, - NULL, NULL, NULL, &e); - if (!g_shell_parse_argv(startup_cmd, NULL, &argv, &e)) { - g_message("Error launching startup command: %s", - e->message); - g_error_free(e); - e = NULL; - } - } + if (startup_cmd) run_startup_cmd(); /* look for parsing errors */ { @@ -562,6 +545,30 @@ static void remove_args(gint *argc, gchar **argv, gint index, gint num) *argc -= num; } +static void run_startup_cmd(void) +{ + gchar **argv = NULL; + GError *e = NULL; + gboolean ok; + + if (!g_shell_parse_argv(startup_cmd, NULL, &argv, &e)) { + g_message("Error parsing startup command: %s", + e->message); + g_error_free(e); + e = NULL; + } + ok = g_spawn_async(NULL, argv, NULL, + G_SPAWN_SEARCH_PATH | + G_SPAWN_DO_NOT_REAP_CHILD, + NULL, NULL, NULL, &e); + if (!g_shell_parse_argv(startup_cmd, NULL, &argv, &e)) { + g_message("Error launching startup command: %s", + e->message); + g_error_free(e); + e = NULL; + } +} + static void parse_env(void) { const gchar *id;