summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-08-29 15:37:38 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-09-01 13:05:29 -0300
commitaed286aa462471a1cb0f91a4a45d0027a25ea7c2 (patch)
treed82570a36638fabd6498f0f8d27ecb6453c47b57 /src
parentb63e94af31e6aa6f7d22c9ad43a98eee951fb39b (diff)
downloadmutter-aed286aa462471a1cb0f91a4a45d0027a25ea7c2.tar.gz
monitor-stream-src: Generalize function
We'll need to pass a custom callback to the stage views watcher. Generalize and rename the add_view_painted_watches() function to allow accepting custom callbacks. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1421
Diffstat (limited to 'src')
-rw-r--r--src/backends/meta-screen-cast-monitor-stream-src.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c b/src/backends/meta-screen-cast-monitor-stream-src.c
index 760fe7471..0f086cab9 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -277,8 +277,9 @@ uninhibit_hw_cursor (MetaScreenCastMonitorStreamSrc *monitor_src)
}
static void
-add_view_painted_watches (MetaScreenCastMonitorStreamSrc *monitor_src,
- MetaStageWatchPhase watch_phase)
+add_view_watches (MetaScreenCastMonitorStreamSrc *monitor_src,
+ MetaStageWatchPhase watch_phase,
+ MetaStageWatchFunc callback)
{
MetaBackend *backend = get_backend (monitor_src);
MetaRenderer *renderer = meta_backend_get_renderer (backend);
@@ -308,7 +309,7 @@ add_view_painted_watches (MetaScreenCastMonitorStreamSrc *monitor_src,
watch = meta_stage_watch_view (meta_stage,
CLUTTER_STAGE_VIEW (view),
watch_phase,
- stage_painted,
+ callback,
monitor_src);
monitor_src->watches = g_list_prepend (monitor_src->watches, watch);
@@ -343,14 +344,16 @@ meta_screen_cast_monitor_stream_src_enable (MetaScreenCastStreamSrc *src)
meta_cursor_tracker_track_position (cursor_tracker);
G_GNUC_FALLTHROUGH;
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
- add_view_painted_watches (monitor_src,
- META_STAGE_WATCH_AFTER_ACTOR_PAINT);
+ add_view_watches (monitor_src,
+ META_STAGE_WATCH_AFTER_ACTOR_PAINT,
+ stage_painted);
break;
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
inhibit_hw_cursor (monitor_src);
meta_cursor_tracker_track_position (cursor_tracker);
- add_view_painted_watches (monitor_src,
- META_STAGE_WATCH_AFTER_PAINT);
+ add_view_watches (monitor_src,
+ META_STAGE_WATCH_AFTER_PAINT,
+ stage_painted);
break;
}