From 988e5f49dd5c0d0e86c10b5b74cf38fa1104c2b0 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Tue, 30 Oct 2007 18:10:54 +0000 Subject: [PATCH] Add a --sync option to turn on synchronous X calls svn path=/trunk/; revision=3368 --- ChangeLog | 5 +++++ src/main.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 516655345..c971fab59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2207-10-30 iain Holmes + + * src/main.c (meta_parse_options): Add --sync option + (main): Check if the --sync option was passed on command line. + 2007-10-28 Jans Granseuer * src/preview-widget.c (meta_preview_finalize): Free title of diff --git a/src/main.c b/src/main.c index d9d915bc5..e46cac129 100644 --- a/src/main.c +++ b/src/main.c @@ -148,6 +148,7 @@ typedef struct gboolean replace_wm; gboolean disable_sm; gboolean print_version; + gboolean sync; } MetaArguments; /** @@ -200,6 +201,12 @@ meta_parse_options (int *argc, char ***argv, N_("Print version"), NULL }, + { + "sync", 0, 0, G_OPTION_ARG_NONE, + &my_args.sync, + N_("Make X calls synchronous"), + NULL + }, {NULL} }; GOptionContext *ctx; @@ -243,7 +250,7 @@ main (int argc, char **argv) struct sigaction act; sigset_t empty_mask; MetaArguments meta_args; - + if (setlocale (LC_ALL, "") == NULL) meta_warning ("Locale not understood by C library, internationalization will not work\n"); @@ -264,7 +271,6 @@ main (int argc, char **argv) meta_set_verbose (TRUE); if (g_getenv ("METACITY_DEBUG")) meta_set_debugging (TRUE); - meta_set_syncing (g_getenv ("METACITY_SYNC") != NULL); if (g_get_home_dir ()) chdir (g_get_home_dir ()); @@ -278,6 +284,8 @@ main (int argc, char **argv) /* Parse command line arguments.*/ meta_parse_options (&argc, &argv, &meta_args); + meta_set_syncing (meta_args.sync || (g_getenv ("METACITY_SYNC") != NULL)); + if (meta_args.print_version) version ();