wayland: Use a stage paint callback instead of a signal handler on "paint"

This is much more appropriate...
This commit is contained in:
Jasper St. Pierre 2013-12-03 14:43:53 -05:00
parent 2746608eb2
commit 0924c7d61b
3 changed files with 5 additions and 6 deletions

View File

@ -637,6 +637,8 @@ after_stage_paint (ClutterStage *stage,
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);
meta_wayland_compositor_paint_finished (meta_wayland_compositor_get_default ());
} }
static void static void

View File

@ -109,5 +109,6 @@ void meta_wayland_buffer_reference (MetaWaylandBuff
void meta_wayland_compositor_update (MetaWaylandCompositor *compositor, void meta_wayland_compositor_update (MetaWaylandCompositor *compositor,
const ClutterEvent *event); const ClutterEvent *event);
void meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor);
#endif /* META_WAYLAND_PRIVATE_H */ #endif /* META_WAYLAND_PRIVATE_H */

View File

@ -500,11 +500,9 @@ const static struct wl_compositor_interface meta_wayland_compositor_interface =
meta_wayland_compositor_create_region meta_wayland_compositor_create_region
}; };
static void void
paint_finished_cb (ClutterActor *self, void *user_data) meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor)
{ {
MetaWaylandCompositor *compositor = user_data;
while (!wl_list_empty (&compositor->frame_callbacks)) while (!wl_list_empty (&compositor->frame_callbacks))
{ {
MetaWaylandFrameCallback *callback = MetaWaylandFrameCallback *callback =
@ -711,8 +709,6 @@ meta_wayland_init (void)
compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors); compositor->outputs = meta_wayland_compositor_update_outputs (compositor, monitors);
compositor->stage = meta_wayland_stage_new (); compositor->stage = meta_wayland_stage_new ();
g_signal_connect_after (compositor->stage, "paint",
G_CALLBACK (paint_finished_cb), compositor);
g_signal_connect (compositor->stage, "destroy", g_signal_connect (compositor->stage, "destroy",
G_CALLBACK (stage_destroy_cb), NULL); G_CALLBACK (stage_destroy_cb), NULL);