Index: compositor.c
===================================================================
RCS file: /cvs/gnome/metacity/src/compositor.c,v
retrieving revision 1.13
diff -u -p -r1.13 compositor.c
--- compositor.c	16 Sep 2004 23:18:22 -0000	1.13
+++ compositor.c	1 Jul 2005 16:44:54 -0000
@@ -39,7 +39,7 @@
 #endif /* HAVE_COMPOSITE_EXTENSIONS */
 
 #define SHADOW_OFFSET 3
-#define FRAME_INTERVAL_MILLISECONDS ((int)(1000.0/40.0))
+#define FRAME_INTERVAL_MILLISECONDS ((int)(1000.0/80.0))
 
 /* Unlike MetaWindow, there's one of these for _all_ toplevel windows,
  * override redirect or not. We also track unmapped windows as
@@ -93,7 +93,6 @@ struct MetaCompositor
   
   GHashTable *window_hash;
 
-  guint repair_idle;
   guint repair_timeout;
   
   guint enabled : 1;
@@ -231,21 +230,13 @@ meta_compositor_new (MetaDisplay *displa
 
 #ifdef HAVE_COMPOSITE_EXTENSIONS
 static void
-remove_repair_idle (MetaCompositor *compositor)
+remove_repair_timeout (MetaCompositor *compositor)
 {
-  if (compositor->repair_idle || compositor->repair_timeout)
-    meta_topic (META_DEBUG_COMPOSITOR, "Damage idle removed\n");
-  
-  if (compositor->repair_idle != 0)
-    {
-      g_source_remove (compositor->repair_idle);
-      compositor->repair_idle = 0;
-    }
-
   if (compositor->repair_timeout != 0)
     {
       g_source_remove (compositor->repair_timeout);
       compositor->repair_timeout = 0;
+      meta_topic (META_DEBUG_COMPOSITOR, "Damage timeout removed\n");
     }
 }
 #endif /* HAVE_COMPOSITE_EXTENSIONS */
@@ -257,7 +248,7 @@ meta_compositor_unref (MetaCompositor *c
   /* There isn't really a refcount at the moment since
    * there's no ref()
    */
-  remove_repair_idle (compositor);
+  remove_repair_timeout (compositor);
 
   if (compositor->window_hash)
     g_hash_table_destroy (compositor->window_hash);
@@ -509,24 +500,10 @@ do_repair (MetaCompositor *compositor)
       tmp = tmp->next;
     }
 
-  remove_repair_idle (compositor);
-}
-#endif /* HAVE_COMPOSITE_EXTENSIONS */
-
-#ifdef HAVE_COMPOSITE_EXTENSIONS
-static gboolean
-repair_idle_func (void *data)
-{
-  MetaCompositor *compositor = data;
-
-  compositor->repair_idle = 0;
-  do_repair (compositor);
-  
-  return FALSE;
+  remove_repair_timeout (compositor);
 }
 #endif /* HAVE_COMPOSITE_EXTENSIONS */
 
-
 #ifdef HAVE_COMPOSITE_EXTENSIONS
 static gboolean
 repair_timeout_func (void *data)
@@ -569,17 +546,13 @@ meta_compositor_window_get_screen (MetaC
 
 #ifdef HAVE_COMPOSITE_EXTENSIONS
 static void
-ensure_repair_idle (MetaCompositor *compositor)
+ensure_repair_timeout (MetaCompositor *compositor)
 {
-  if (compositor->repair_idle != 0)
-    return;
-
-  compositor->repair_idle = g_idle_add_full (META_PRIORITY_COMPOSITE,
-                                             repair_idle_func, compositor, NULL);
-  compositor->repair_timeout = g_timeout_add (FRAME_INTERVAL_MILLISECONDS,
-                                              repair_timeout_func, compositor);
+  if (compositor->repair_timeout == 0)
+    compositor->repair_timeout = g_timeout_add (FRAME_INTERVAL_MILLISECONDS,
+                                                repair_timeout_func, compositor);
 
-  meta_topic (META_DEBUG_COMPOSITOR, "Damage idle queued\n");
+  meta_topic (META_DEBUG_COMPOSITOR, "Damage timeout queued\n");
 }
 #endif /* HAVE_COMPOSITE_EXTENSIONS */
 
@@ -602,7 +575,7 @@ merge_and_destroy_damage_region (MetaCom
       screen->damage_region = region;
     }
 
-  ensure_repair_idle (compositor);
+  ensure_repair_timeout (compositor);
 }
 #endif /* HAVE_COMPOSITE_EXTENSIONS */
 
@@ -623,7 +596,7 @@ merge_damage_region (MetaCompositor *com
                      screen->damage_region,
                      region, screen->damage_region);
 
-  ensure_repair_idle (compositor);
+  ensure_repair_timeout (compositor);
 }
 #endif /* HAVE_COMPOSITE_EXTENSIONS */
 
