From 2bea178fb7fa66e366e9d868aba1ae5f7d680e0a Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Mon, 25 Jul 2022 22:12:32 +0200 Subject: [PATCH] mac-capture: Fix issue with desktop capture introduced by macOS 12.5 Initializing a display stream with a content filter which excludes an empty list of windows leads to a broken stream. Initializing with a list of all available windows as a workaround re-enables functionality. --- plugins/mac-capture/mac-screen-capture.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plugins/mac-capture/mac-screen-capture.m b/plugins/mac-capture/mac-screen-capture.m index 670c12007..ad4753eeb 100644 --- a/plugins/mac-capture/mac-screen-capture.m +++ b/plugins/mac-capture/mac-screen-capture.m @@ -376,9 +376,15 @@ static bool init_screen_stream(struct screen_capture *sc) case ScreenCaptureDisplayStream: { SCDisplay *target_display = get_target_display(); - content_filter = [[SCContentFilter alloc] - initWithDisplay:target_display - excludingWindows:[[NSArray alloc] init]]; + if (@available(macOS 13.0, *)) { + content_filter = [[SCContentFilter alloc] + initWithDisplay:target_display + excludingWindows:[[NSArray alloc] init]]; + } else { + content_filter = [[SCContentFilter alloc] + initWithDisplay:target_display + includingWindows:sc->shareable_content.windows]; + } set_display_mode(sc, target_display); } break;