[mutter] Use new clutter_stage_set_paint_callback() function for after-paint notification



commit 47b21b3547775baaec51f10aa7ef3d77ea093803
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Apr 24 16:49:06 2013 -0400

    Use new clutter_stage_set_paint_callback() function for after-paint notification
    
    Commit 4f2bb583bf8c changed things so that the compositor used
    clutter_threads_add_repaint_func_full (CLUTTER_REPAINT_FLAGS_POST_PAINT
    to get after-paint notification and send _NET_WM_FRAME_DRAWN, but this
    doesn't actually work, since Clutter will already have blocked for
    VBlank before calling post-paint functions.
    
    The result is that frame synced toolkits like GTK 3.8 will normally
    only be able to draw every other frame.
    
    Since ::paint doesn't work either, a new function
    clutter_stage_set_paint_callback() has been added to Clutter
    (and will be included in the 1.14 branch)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698794

 configure.ac                |    2 +-
 src/compositor/compositor.c |   17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index af9bdaf..7679105 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,7 +73,7 @@ MUTTER_PC_MODULES="
    cairo >= 1.10.0
    gsettings-desktop-schemas >= 3.7.3
    xcomposite >= 0.2 xfixes xrender xdamage xi >= 1.6.0
-   $CLUTTER_PACKAGE >= 1.13.5
+   $CLUTTER_PACKAGE >= 1.14.3
    cogl-1.0 >= 1.13.3
 "
 
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 40b9854..459ddf2 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -517,20 +517,20 @@ meta_check_end_modal (MetaScreen *screen)
     {
       meta_end_modal_for_plugin (screen,
                                    compositor->modal_plugin,
-                                   CurrentTime);
+
+                                 CurrentTime);
     }
 }
 
-static gboolean
-after_stage_paint (gpointer data)
+static void
+after_stage_paint (ClutterStage *stage,
+                   gpointer      data)
 {
   MetaCompScreen *info = (MetaCompScreen*) data;
   GList *l;
 
   for (l = info->windows; l; l = l->next)
     meta_window_actor_post_paint (l->data);
-
-  return TRUE;
 }
 
 static void
@@ -611,9 +611,10 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
 
   info->stage = clutter_stage_new ();
 
-  clutter_threads_add_repaint_func_full (CLUTTER_REPAINT_FLAGS_POST_PAINT,
-                                         after_stage_paint,
-                                         info, NULL);
+  clutter_stage_set_paint_callback (CLUTTER_STAGE (info->stage),
+                                    after_stage_paint,
+                                    info,
+                                    NULL);
 
   clutter_stage_set_sync_delay (CLUTTER_STAGE (info->stage), META_SYNC_DELAY);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]