screen-cast/monitor-src: Always set before-paint watch

We weren't setting it for META_SCREEN_CAST_CURSOR_MODE_EMBEDDED, so
that case didn't work correctly with scanouts.

Suggested by Georges Basile Stavracas Neto.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1914>
This commit is contained in:
Michel Dänzer 2021-06-25 18:29:06 +02:00 committed by Marge Bot
parent 42797224b5
commit 10d1de2bdf

View File

@ -340,13 +340,14 @@ reattach_watches (MetaScreenCastMonitorStreamSrc *monitor_src)
meta_stage_remove_watch (META_STAGE (stage), l->data);
g_clear_pointer (&monitor_src->watches, g_list_free);
add_view_watches (monitor_src,
META_STAGE_WATCH_BEFORE_PAINT,
before_stage_painted);
switch (meta_screen_cast_stream_get_cursor_mode (stream))
{
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
add_view_watches (monitor_src,
META_STAGE_WATCH_BEFORE_PAINT,
before_stage_painted);
add_view_watches (monitor_src,
META_STAGE_WATCH_AFTER_ACTOR_PAINT,
stage_painted);