Use new clutter_stage_set_paint_callback() function for after-paint notification

Commit 4f2bb583bf 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
This commit is contained in:
Owen W. Taylor 2013-04-24 16:49:06 -04:00
parent c119f98bac
commit 47b21b3547
2 changed files with 10 additions and 9 deletions

View File

@ -73,7 +73,7 @@ MUTTER_PC_MODULES="
cairo >= 1.10.0 cairo >= 1.10.0
gsettings-desktop-schemas >= 3.7.3 gsettings-desktop-schemas >= 3.7.3
xcomposite >= 0.2 xfixes xrender xdamage xi >= 1.6.0 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 cogl-1.0 >= 1.13.3
" "

View File

@ -517,20 +517,20 @@ meta_check_end_modal (MetaScreen *screen)
{ {
meta_end_modal_for_plugin (screen, meta_end_modal_for_plugin (screen,
compositor->modal_plugin, compositor->modal_plugin,
CurrentTime);
CurrentTime);
} }
} }
static gboolean static void
after_stage_paint (gpointer data) after_stage_paint (ClutterStage *stage,
gpointer data)
{ {
MetaCompScreen *info = (MetaCompScreen*) data; MetaCompScreen *info = (MetaCompScreen*) data;
GList *l; GList *l;
for (l = info->windows; l; l = l->next) for (l = info->windows; l; l = l->next)
meta_window_actor_post_paint (l->data); meta_window_actor_post_paint (l->data);
return TRUE;
} }
static void static void
@ -611,9 +611,10 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
info->stage = clutter_stage_new (); info->stage = clutter_stage_new ();
clutter_threads_add_repaint_func_full (CLUTTER_REPAINT_FLAGS_POST_PAINT, clutter_stage_set_paint_callback (CLUTTER_STAGE (info->stage),
after_stage_paint, after_stage_paint,
info, NULL); info,
NULL);
clutter_stage_set_sync_delay (CLUTTER_STAGE (info->stage), META_SYNC_DELAY); clutter_stage_set_sync_delay (CLUTTER_STAGE (info->stage), META_SYNC_DELAY);