Просмотр исходного кода

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.
PatTheMav 3 лет назад
Родитель
Сommit
2bea178fb7
1 измененных файлов с 9 добавлено и 3 удалено
  1. 9 3
      plugins/mac-capture/mac-screen-capture.m

+ 9 - 3
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;