metacity r3838 - in trunk: . src/core src/include
- From: tthurman svn gnome org
- To: svn-commits-list gnome org
- Subject: metacity r3838 - in trunk: . src/core src/include
- Date: Sun, 31 Aug 2008 22:55:19 +0000 (UTC)
Author: tthurman
Date: Sun Aug 31 22:55:18 2008
New Revision: 3838
URL: http://svn.gnome.org/viewvc/metacity?rev=3838&view=rev
Log:
2008-08-31 Thomas Thurman <tthurman gnome org>
* src/core/prefs.[ch] (meta_prefs_set_compositing_manager): new
function.
* src/core/main.c (meta_parse_options): turn the compositing
manager on or off as necessary.
Modified:
trunk/ChangeLog
trunk/src/core/main.c
trunk/src/core/prefs.c
trunk/src/include/prefs.h
Modified: trunk/src/core/main.c
==============================================================================
--- trunk/src/core/main.c (original)
+++ trunk/src/core/main.c Sun Aug 31 22:55:18 2008
@@ -217,8 +217,17 @@
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 @@
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 @@
"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 @@
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 @@
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);
Modified: trunk/src/core/prefs.c
==============================================================================
--- trunk/src/core/prefs.c (original)
+++ trunk/src/core/prefs.c Sun Aug 31 22:55:18 2008
@@ -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 @@
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)
Modified: trunk/src/include/prefs.h
==============================================================================
--- trunk/src/include/prefs.h (original)
+++ trunk/src/include/prefs.h Sun Aug 31 22:55:18 2008
@@ -113,6 +113,13 @@
int meta_prefs_get_cursor_size (void);
gboolean meta_prefs_get_compositing_manager (void);
+/**
+ * Sets whether the compositor is turned on.
+ *
+ * \param whether TRUE to turn on, FALSE to turn off
+ */
+void meta_prefs_set_compositing_manager (gboolean whether);
+
/* Screen bindings */
#define META_KEYBINDING_WORKSPACE_1 "switch_to_workspace_1"
#define META_KEYBINDING_WORKSPACE_2 "switch_to_workspace_2"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]