diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 5918c9047..ff6a6aa73 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -1246,10 +1246,16 @@ meta_compositor_get_property (GObject *object, static void meta_compositor_init (MetaCompositor *compositor) { +} + +static void +meta_compositor_constructed (GObject *object) +{ + MetaCompositor *compositor = META_COMPOSITOR (object); MetaCompositorPrivate *priv = meta_compositor_get_instance_private (compositor); - MetaBackend *backend = meta_get_backend (); - ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); + ClutterBackend *clutter_backend = + meta_backend_get_clutter_backend (priv->backend); priv->context = clutter_backend->cogl_context; @@ -1265,6 +1271,8 @@ meta_compositor_init (MetaCompositor *compositor) NULL); priv->laters = meta_laters_new (compositor); + + G_OBJECT_CLASS (meta_compositor_parent_class)->constructed (object); } static void @@ -1303,6 +1311,7 @@ meta_compositor_class_init (MetaCompositorClass *klass) object_class->set_property = meta_compositor_set_property; object_class->get_property = meta_compositor_get_property; + object_class->constructed = meta_compositor_constructed; object_class->dispose = meta_compositor_dispose; klass->remove_window = meta_compositor_real_remove_window; diff --git a/src/compositor/meta-later.c b/src/compositor/meta-later.c index 67e229d38..9265f2e44 100644 --- a/src/compositor/meta-later.c +++ b/src/compositor/meta-later.c @@ -50,7 +50,7 @@ struct _MetaLaters GSList *laters[META_LATER_N_TYPES]; - gulong pre_paint_handler_id; + gulong before_update_handler_id; }; static MetaLater * @@ -165,8 +165,8 @@ run_repaint_laters (GSList **laters_list) } static void -on_pre_paint (MetaCompositor *compositor, - MetaLaters *laters) +on_before_update (ClutterStage *stage, + MetaLaters *laters) { unsigned int i; GSList *l; @@ -187,11 +187,7 @@ on_pre_paint (MetaCompositor *compositor, } if (needs_schedule_update) - { - ClutterStage *stage = meta_compositor_get_stage (compositor); - - clutter_stage_schedule_update (stage); - } + clutter_stage_schedule_update (stage); } static gboolean @@ -320,14 +316,16 @@ meta_later_remove (unsigned int later_id) MetaLaters * meta_laters_new (MetaCompositor *compositor) { + ClutterStage *stage = meta_compositor_get_stage (compositor); MetaLaters *laters; laters = g_new0 (MetaLaters, 1); laters->compositor = compositor; - laters->pre_paint_handler_id = g_signal_connect (compositor, "pre-paint", - G_CALLBACK (on_pre_paint), - laters); + laters->before_update_handler_id = + g_signal_connect (stage, "before-update", + G_CALLBACK (on_before_update), + laters); return laters; } @@ -335,11 +333,12 @@ meta_laters_new (MetaCompositor *compositor) void meta_laters_free (MetaLaters *laters) { + ClutterStage *stage = meta_compositor_get_stage (laters->compositor); unsigned int i; for (i = 0; i < G_N_ELEMENTS (laters->laters); i++) g_slist_free_full (laters->laters[i], (GDestroyNotify) meta_later_unref); - g_clear_signal_handler (&laters->pre_paint_handler_id, laters->compositor); + g_clear_signal_handler (&laters->before_update_handler_id, stage); g_free (laters); }