diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/main.c | 31 | ||||
-rw-r--r-- | src/core/prefs.c | 19 |
2 files changed, 47 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c index ee524585..3d7706aa 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -217,8 +217,17 @@ typedef struct gboolean disable_sm; gboolean print_version; gboolean sync; + gboolean composite; + gboolean no_composite; } MetaArguments; +#ifdef HAVE_COMPOSITE_EXTENSIONS +#define COMPOSITE_OPTS_FLAGS 0 +#else /* HAVE_COMPOSITE_EXTENSIONS */ +/* No compositor, so don't show the arguments in --help */ +#define COMPOSITE_OPTS_FLAGS G_OPTION_FLAG_HIDDEN +#endif /* HAVE_COMPOSITE_EXTENSIONS */ + /** * Parses argc and argv and returns the * arguments that Metacity understands in meta_args. @@ -235,7 +244,8 @@ static void meta_parse_options (int *argc, char ***argv, MetaArguments *meta_args) { - MetaArguments my_args = {NULL, NULL, NULL, FALSE, FALSE, FALSE}; + MetaArguments my_args = {NULL, NULL, NULL, + FALSE, FALSE, FALSE, FALSE, FALSE}; GOptionEntry options[] = { { "sm-disable", 0, 0, G_OPTION_ARG_NONE, @@ -256,7 +266,7 @@ meta_parse_options (int *argc, char ***argv, "ID" }, { - "display", 0, 0, G_OPTION_ARG_STRING, + "display", 'd', 0, G_OPTION_ARG_STRING, &my_args.display_name, N_("X Display to use"), "DISPLAY" }, @@ -278,6 +288,18 @@ meta_parse_options (int *argc, char ***argv, N_("Make X calls synchronous"), NULL }, + { + "composite", 'c', COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, + &my_args.composite, + N_("Turn compositing on"), + NULL + }, + { + "no-composite", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE, + &my_args.no_composite, + N_("Turn compositing off"), + NULL + }, {NULL} }; GOptionContext *ctx; @@ -473,7 +495,10 @@ main (int argc, char **argv) g_free (meta_args.save_file); g_free (meta_args.display_name); g_free (meta_args.client_id); - + + if (meta_args.composite || meta_args.no_composite) + meta_prefs_set_compositing_manager (meta_args.composite); + if (!meta_display_open ()) meta_exit (META_EXIT_ERROR); diff --git a/src/core/prefs.c b/src/core/prefs.c index fb3ffa19..82a4c2c9 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -49,6 +49,7 @@ */ #define KEY_TITLEBAR_FONT "/apps/metacity/general/titlebar_font" #define KEY_NUM_WORKSPACES "/apps/metacity/general/num_workspaces" +#define KEY_COMPOSITOR "/apps/metacity/general/compositing_manager" #define KEY_GNOME_ACCESSIBILITY "/desktop/gnome/interface/accessibility" #define KEY_COMMAND_PREFIX "/apps/metacity/keybinding_commands/command_" @@ -2944,6 +2945,24 @@ meta_prefs_get_compositing_manager (void) return compositing_manager; } +void +meta_prefs_set_compositing_manager (gboolean whether) +{ + GError *err = NULL; + + gconf_client_set_bool (default_client, + KEY_COMPOSITOR, + whether, + &err); + + if (err) + { + meta_warning (_("Error setting compositor status: %s\n"), + err->message); + g_error_free (err); + } +} + #ifndef HAVE_GCONF static void init_button_layout(void) |