From d4c923edf9d5e519a266f3a7933f93ca934f5d63 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 11 Aug 2023 16:18:54 -0300 Subject: [PATCH] screen-cast/window-src: Report alpha-enabled pixel format This allows windows screencasts with proper shadows, instead of a black border around the window! Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2099 Part-of: --- src/backends/meta-screen-cast-window-stream-src.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/backends/meta-screen-cast-window-stream-src.c b/src/backends/meta-screen-cast-window-stream-src.c index fca0b214c..0cd52e818 100644 --- a/src/backends/meta-screen-cast-window-stream-src.c +++ b/src/backends/meta-screen-cast-window-stream-src.c @@ -619,6 +619,12 @@ meta_screen_cast_window_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc } } +static CoglPixelFormat +meta_screen_cast_window_stream_src_get_preferred_format (MetaScreenCastStreamSrc *src) +{ + return COGL_PIXEL_FORMAT_BGRA_8888_PRE; +} + MetaScreenCastWindowStreamSrc * meta_screen_cast_window_stream_src_new (MetaScreenCastWindowStream *window_stream, GError **error) @@ -651,4 +657,6 @@ meta_screen_cast_window_stream_src_class_init (MetaScreenCastWindowStreamSrcClas meta_screen_cast_window_stream_record_follow_up; src_class->get_videocrop = meta_screen_cast_window_stream_src_get_videocrop; src_class->set_cursor_metadata = meta_screen_cast_window_stream_src_set_cursor_metadata; + src_class->get_preferred_format = + meta_screen_cast_window_stream_src_get_preferred_format; }