Index: configure.in
===================================================================
RCS file: /cvs/gnome/metacity/configure.in,v
retrieving revision 1.124
diff -u -r1.124 configure.in
--- configure.in	15 Jul 2003 21:54:22 -0000	1.124
+++ configure.in	17 Jul 2003 19:37:02 -0000
@@ -343,6 +343,16 @@
    AM_GCONF_SOURCE_2
 fi
 
+have_gnome_animation_key=no
+if test x$enable_gconf = xyes; then
+## since libgnome 2.4 we have a global animation key
+   if $PKG_CONFIG --atleast-version 2.1.4 libgnome-2.0; then
+   have_gnome_animation_key=yes
+   AC_DEFINE(HAVE_GNOME_ANIMATION_KEY, $have_gnome_animation_key, [GNOME schema is installed])
+   AC_SUBST (HAVE_GNOME_ANIMATION_KEY)
+   fi
+fi
+
 AC_OUTPUT([
 Makefile
 doc/Makefile
@@ -390,5 +400,6 @@
 	Resize-and-rotate:        ${found_randr}
 	Xsync:                    ${found_xsync}
         Deprecated config dialog: ${enable_config_dialog}
+	Have GNOME animation key: ${have_gnome_animation_key}
 "
 echo "This is the UNSTABLE branch of metacity, use 2.4.x for stable (gnome-2-2 branch in CVS)"
Index: src/prefs.c
===================================================================
RCS file: /cvs/gnome/metacity/src/prefs.c,v
retrieving revision 1.44
diff -u -r1.44 prefs.c
--- src/prefs.c	27 Jun 2003 14:49:56 -0000	1.44
+++ src/prefs.c	17 Jul 2003 19:37:02 -0000
@@ -62,6 +62,10 @@
 #define KEY_AUDIBLE_BELL "/apps/metacity/general/audible_bell"
 #define KEY_VISUAL_BELL_TYPE "/apps/metacity/general/visual_bell_type"
 
+#ifdef HAVE_GNOME_ANIMATION_KEY
+#define KEY_GNOME_ENABLE_ANIMATIONS "/desktop/gnome/interface/enable_animations"
+#endif
+
 #ifdef HAVE_GCONF
 static GConfClient *default_client = NULL;
 static GList *changes = NULL;
@@ -83,6 +87,9 @@
 static gboolean auto_raise_delay = 500;
 static gboolean provide_visual_bell = TRUE;
 static gboolean bell_is_audible = TRUE;
+#ifdef HAVE_GNOME_ANIMATION_KEY
+static gboolean enable_animations = TRUE;
+#endif /* HAVE_GNOME_ANIMATION_KEY */
 static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_INVALID;
 static MetaButtonLayout button_layout = {
   {
@@ -129,6 +136,10 @@
                                            const char  *value);
 static gboolean update_workspace_name     (const char  *name,
                                            const char  *value);
+#ifdef HAVE_GNOME_ANIMATION_KEY
+static gboolean update_enable_animations  (gboolean value);
+#endif /* HAVE_GNOME_ANIMATION_KEY */
+
 
 static void change_notify (GConfClient    *client,
                            guint           cnxn_id,
@@ -371,6 +382,19 @@
                                      &err);
   cleanup_error (&err);
   update_button_layout (str_val);
+
+#ifdef HAVE_GNOME_ANIMATION_KEY
+  gconf_client_add_dir (default_client, "/desktop/gnome/interface",
+                        GCONF_CLIENT_PRELOAD_ONELEVEL,
+                        &err);
+  cleanup_error (&err);
+
+  bool_val = gconf_client_get_bool (default_client, KEY_GNOME_ENABLE_ANIMATIONS,
+		  		    &err);
+  cleanup_error (&err);
+  update_enable_animations (bool_val);
+#endif
+
   g_free (str_val);
 #endif /* HAVE_GCONF */
   
@@ -404,6 +428,14 @@
                            NULL,
                            &err);
   cleanup_error (&err);  
+#ifdef HAVE_GNOME_ANIMATION_KEY
+  gconf_client_notify_add (default_client, "/desktop/gnome/interface",
+                           change_notify,
+                           NULL,
+                           NULL,
+                           &err);
+  cleanup_error (&err);  
+#endif /* HAVE_GNOME_ANIMATION_KEY */
 #endif /* HAVE_GCONF */
 }
 
@@ -733,6 +765,24 @@
       if (update_visual_bell_type (str))
 	queue_changed (META_PREF_VISUAL_BELL_TYPE);
     }
+#ifdef HAVE_GNOME_ANIMATION_KEY
+  else if (strcmp (key, KEY_GNOME_ENABLE_ANIMATIONS) == 0)
+    {
+      gboolean b;
+
+      if (value && value->type != GCONF_VALUE_BOOL)
+        {
+          meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
+                        KEY_AUTO_RAISE);
+          goto out;
+        }
+
+      b = value ? gconf_value_get_bool (value) : enable_animations;
+
+      if (update_enable_animations (b))
+        queue_changed (GNOME_PREF_ENABLE_ANIMATIONS);
+    }
+#endif /* HAVE_GNOME_ANIMATION_KEY */
   else
     {
       meta_topic (META_DEBUG_PREFS, "Key %s doesn't mean anything to Metacity\n",
@@ -890,6 +940,7 @@
 
   return (visual_bell_type != old_bell_type);
 }
+
 #endif /* HAVE_GCONF */
 
 static gboolean
@@ -1241,6 +1292,26 @@
 }
 #endif /* HAVE_GCONF */
 
+#ifdef HAVE_GCONF
+#ifdef HAVE_GNOME_ANIMATION_KEY
+static gboolean
+update_enable_animations (gboolean value)
+{
+	gboolean old = enable_animations;
+
+	enable_animations = value;
+
+	return old != enable_animations;
+}
+
+gboolean
+meta_prefs_get_enable_animations (void)
+{
+  return enable_animations;
+}
+#endif /* HAVE_GNOME_ANIMATION_KEY */
+#endif /* HAVE_GCONF */
+
 #ifdef WITH_VERBOSE_MODE
 const char*
 meta_preference_to_string (MetaPreference pref)
@@ -1305,6 +1376,12 @@
     case META_PREF_VISUAL_BELL_TYPE:
       return "VISUAL_BELL_TYPE";
       break;
+
+#ifdef HAVE_GNOME_ANIMATION_KEY
+    case GNOME_PREF_ENABLE_ANIMATIONS:
+      return "ENABLE_ANIMATIONS";
+      break;
+#endif /* HAVE_GNOME_ANIMATION_KEY */
     }
 
   return "(unknown)";
Index: src/prefs.h
===================================================================
RCS file: /cvs/gnome/metacity/src/prefs.h,v
retrieving revision 1.32
diff -u -r1.32 prefs.h
--- src/prefs.h	27 Jun 2003 14:49:56 -0000	1.32
+++ src/prefs.h	17 Jul 2003 19:37:02 -0000
@@ -45,7 +45,12 @@
   META_PREF_WORKSPACE_NAMES,
   META_PREF_VISUAL_BELL,
   META_PREF_AUDIBLE_BELL,
+#ifdef HAVE_GNOME_ANIMATION_KEY
+  META_PREF_VISUAL_BELL_TYPE,
+  GNOME_PREF_ENABLE_ANIMATIONS
+#else
   META_PREF_VISUAL_BELL_TYPE
+#endif /* HAVE_GNOME_ANIMATION_KEY */
 } MetaPreference;
 
 typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -257,6 +262,9 @@
 gboolean           meta_prefs_bell_is_audible      (void);
 MetaVisualBellType meta_prefs_get_visual_bell_type (void);
 
+#ifdef HAVE_GNOME_SCHEMA
+gboolean	   meta_prefs_get_enable_animations (void);
+#endif
 #endif
 
 
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.291
diff -u -r1.291 window.c
--- src/window.c	30 Jun 2003 14:49:11 -0000	1.291
+++ src/window.c	17 Jul 2003 19:37:05 -0000
@@ -1258,6 +1258,9 @@
 
           meta_window_get_outer_rect (window, &window_rect);
           
+#ifdef HAVE_GNOME_ANIMATION_KEY
+	  if (meta_prefs_get_enable_animations())
+#endif /* HAVE_GNOME_ANIMATION_KEY */
           /* Draw a nice cool animation */
           meta_effects_draw_box_animation (window->screen,
                                            &window_rect,
@@ -1973,6 +1976,9 @@
           titlebar_size = starting_size;
           titlebar_size.height = 0;
           
+#ifdef HAVE_GNOME_ANIMATION_KEY
+	  if (meta_prefs_get_enable_animations())
+#endif /* HAVE_GNOME_ANIMATION_KEY */
           meta_effects_draw_box_animation (window->screen,
                                            &starting_size,
                                            &titlebar_size,
