diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-06-03 11:38:32 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2020-07-02 19:36:51 +0200 |
commit | 8cff3b84f7263480cbe2c9757c61b566d2941246 (patch) | |
tree | c4c07b092ebb865b8db5384e36fc928c4394544f /src | |
parent | 578c30792aa2d893b23334d0e0e48953fc69f563 (diff) | |
download | mutter-8cff3b84f7263480cbe2c9757c61b566d2941246.tar.gz |
wayland/compositor: Process frame callbacks on 'after-update'
Instead of going via MetaCompositor to know about when we updated
(confusingly named post-paint), use the new stage signal directly.
Note that this doesn't change the time frame callbacks are dispatched;
it's still not tied to actual painting even though it seemed so before
given the function names.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor/compositor.c | 5 | ||||
-rw-r--r-- | src/wayland/meta-wayland.c | 12 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 9afb1a5ea..65c1c3034 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -1142,11 +1142,6 @@ meta_compositor_real_post_paint (MetaCompositor *compositor) meta_compositor_get_instance_private (compositor); CoglGraphicsResetStatus status; -#ifdef HAVE_WAYLAND - if (meta_is_wayland_compositor ()) - meta_wayland_compositor_paint_finished (meta_wayland_compositor_get_default ()); -#endif - status = cogl_get_graphics_reset_status (priv->context); switch (status) { diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index e4b09cbfc..30d3979ba 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -194,8 +194,9 @@ meta_wayland_compositor_update (MetaWaylandCompositor *compositor, meta_wayland_seat_update (compositor->seat, event); } -void -meta_wayland_compositor_paint_finished (MetaWaylandCompositor *compositor) +static void +on_after_update (ClutterStage *stage, + MetaWaylandCompositor *compositor) { GList *l; int64_t now_us; @@ -397,9 +398,9 @@ meta_wayland_compositor_new (MetaBackend *backend) } void -meta_wayland_compositor_setup (MetaWaylandCompositor *wayland_compositor) +meta_wayland_compositor_setup (MetaWaylandCompositor *compositor) { - MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); + ClutterActor *stage = meta_backend_get_stage (compositor->backend); GSource *wayland_event_source; wayland_event_source = wayland_event_source_new (compositor->wayland_display); @@ -413,6 +414,9 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *wayland_compositor) g_source_set_priority (wayland_event_source, GDK_PRIORITY_EVENTS + 1); g_source_attach (wayland_event_source, NULL); + g_signal_connect (stage, "after-update", + G_CALLBACK (on_after_update), compositor); + if (!wl_global_create (compositor->wayland_display, &wl_compositor_interface, META_WL_COMPOSITOR_VERSION, |