diff options
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/core/main.c b/src/core/main.c index 8a2f796a..6758ae7d 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -2,10 +2,10 @@ /* Metacity main() */ -/* +/* * Copyright (C) 2001 Havoc Pennington * Copyright (C) 2006 Elijah Newren - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -15,13 +15,13 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ /** - * \file + * \file * Program startup. * Functions which parse the command-line arguments, create the display, * kick everything off and then close down Metacity when it's time to go. @@ -206,7 +206,7 @@ meta_print_self_identity (void) g_date_strftime (buf, sizeof (buf), "%x", &d); meta_verbose ("Metacity version %s running on %s\n", VERSION, buf); - + /* Locale and encoding. */ g_get_charset (&charset); meta_verbose ("Running in locale \"%s\" with encoding \"%s\"\n", @@ -455,7 +455,7 @@ main (int argc, char **argv) g_get_home_dir ()); meta_print_self_identity (); - + bindtextdomain (GETTEXT_PACKAGE, METACITY_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); @@ -469,16 +469,16 @@ main (int argc, char **argv) version (); meta_select_display (meta_args.display_name); - + if (meta_args.replace_wm) meta_set_replace_current_wm (TRUE); if (meta_args.save_file && meta_args.client_id) meta_fatal ("Can't specify both SM save file and SM client id\n"); - + meta_main_loop = g_main_loop_new (NULL, FALSE); - - meta_ui_init (&argc, &argv); + + meta_ui_init (&argc, &argv); /* must be after UI init so we can override GDK handlers */ meta_errors_init (); @@ -499,7 +499,7 @@ main (int argc, char **argv) if (g_getenv ("METACITY_G_FATAL_WARNINGS") != NULL) g_log_set_always_fatal (G_LOG_LEVEL_MASK); - + meta_ui_set_current_theme (meta_prefs_get_theme (), FALSE); /* Try to find some theme that'll work if the theme preference @@ -508,34 +508,34 @@ main (int argc, char **argv) */ if (!meta_ui_have_a_theme ()) meta_ui_set_current_theme ("Simple", FALSE); - + if (!meta_ui_have_a_theme ()) { const char *dir_entry = NULL; GError *err = NULL; GDir *themes_dir = NULL; - + if (!(themes_dir = g_dir_open (METACITY_DATADIR"/themes", 0, &err))) { meta_fatal (_("Failed to scan themes directory: %s\n"), err->message); g_error_free (err); - } - else + } + else { - while (((dir_entry = g_dir_read_name (themes_dir)) != NULL) && + while (((dir_entry = g_dir_read_name (themes_dir)) != NULL) && (!meta_ui_have_a_theme ())) { meta_ui_set_current_theme (dir_entry, FALSE); } - + g_dir_close (themes_dir); } } - + if (!meta_ui_have_a_theme ()) meta_fatal (_("Could not find a theme! Be sure %s exists and contains the usual themes.\n"), METACITY_DATADIR"/themes"); - + /* Connect to SM as late as possible - but before managing display, * or we might try to manage a window before we have the session * info @@ -545,9 +545,9 @@ main (int argc, char **argv) if (meta_args.client_id == NULL) { const gchar *desktop_autostart_id; - + desktop_autostart_id = g_getenv ("DESKTOP_AUTOSTART_ID"); - + if (desktop_autostart_id != NULL) meta_args.client_id = g_strdup (desktop_autostart_id); } @@ -573,7 +573,7 @@ main (int argc, char **argv) if (!meta_display_open ()) meta_exit (META_EXIT_ERROR); - + g_main_loop_run (meta_main_loop); meta_finalize (); @@ -598,7 +598,7 @@ main (int argc, char **argv) meta_exit_code = META_EXIT_ERROR; } } - + return meta_exit_code; } |