diff --git a/src/backends/meta-screen-cast-virtual-stream-src.c b/src/backends/meta-screen-cast-virtual-stream-src.c index c7174dd2a..3f33a8538 100644 --- a/src/backends/meta-screen-cast-virtual-stream-src.c +++ b/src/backends/meta-screen-cast-virtual-stream-src.c @@ -355,11 +355,38 @@ meta_screen_cast_virtual_stream_src_record_to_buffer (MetaScreenCastStreamSrc * uint8_t *data, GError **error) { - clutter_stage_capture_view_into (stage_from_src (src), - view_from_src (src), - NULL, - data, - stride); + MetaScreenCastStream *stream; + ClutterPaintFlag paint_flags; + ClutterStageView *view; + MetaRectangle view_rect; + float scale; + + stream = meta_screen_cast_stream_src_get_stream (src); + view = view_from_src (src); + scale = clutter_stage_view_get_scale (view); + clutter_stage_view_get_layout (view, &view_rect); + + paint_flags = CLUTTER_PAINT_FLAG_CLEAR; + switch (meta_screen_cast_stream_get_cursor_mode (stream)) + { + case META_SCREEN_CAST_CURSOR_MODE_METADATA: + case META_SCREEN_CAST_CURSOR_MODE_HIDDEN: + paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS; + break; + case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED: + paint_flags |= CLUTTER_PAINT_FLAG_FORCE_CURSORS; + break; + } + + if (!clutter_stage_paint_to_buffer (stage_from_src (src), + &view_rect, + scale, + data, + stride, + CLUTTER_CAIRO_FORMAT_ARGB32, + paint_flags, + error)) + return FALSE; return TRUE; }