diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c b/src/backends/meta-screen-cast-monitor-stream-src.c index ed0d854c1..6bcffd9a5 100644 --- a/src/backends/meta-screen-cast-monitor-stream-src.c +++ b/src/backends/meta-screen-cast-monitor-stream-src.c @@ -158,14 +158,24 @@ stage_painted (MetaStage *stage, MetaScreenCastMonitorStreamSrc *monitor_src = META_SCREEN_CAST_MONITOR_STREAM_SRC (user_data); MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src); + MetaScreenCastRecordResult record_result; + MetaScreenCastRecordFlag flags; if (monitor_src->maybe_record_idle_id) return; - monitor_src->maybe_record_idle_id = g_idle_add (maybe_record_frame_on_idle, - src); - g_source_set_name_by_id (monitor_src->maybe_record_idle_id, - "[mutter] maybe_record_frame_on_idle [monitor-src]"); + flags = META_SCREEN_CAST_RECORD_FLAG_DMABUF_ONLY; + record_result = meta_screen_cast_stream_src_maybe_record_frame (src, + flags, + NULL); + + if (!(record_result & META_SCREEN_CAST_RECORD_RESULT_RECORDED_FRAME)) + { + monitor_src->maybe_record_idle_id = g_idle_add (maybe_record_frame_on_idle, + src); + g_source_set_name_by_id (monitor_src->maybe_record_idle_id, + "[mutter] maybe_record_frame_on_idle [monitor-src]"); + } } static void