From 2a3eb9f367a70e2f5060d9dea6edd5ccd326de61 Mon Sep 17 00:00:00 2001 From: erikchen Date: Tue, 15 Nov 2016 10:24:43 -0800 Subject: [PATCH] mac: Fix screen capture on secondary displays. The old API CGScreenRegisterMoveCallback returned update rects in desktop coordinates [secondary display has an origin != 0,0]. The new CGDisplayStream API returns update rects in display coordinates [origin == 0,0]. Translating the update rect based on the display's position on the desktop is now incorrect. BUG=webrtc:6702 Review-Url: https://codereview.webrtc.org/2496413002 Cr-Commit-Position: refs/heads/master@{#15092} --- webrtc/modules/desktop_capture/screen_capturer_mac.mm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/webrtc/modules/desktop_capture/screen_capturer_mac.mm b/webrtc/modules/desktop_capture/screen_capturer_mac.mm index 34f5087442..f11b36d2d2 100644 --- a/webrtc/modules/desktop_capture/screen_capturer_mac.mm +++ b/webrtc/modules/desktop_capture/screen_capturer_mac.mm @@ -990,13 +990,9 @@ void ScreenCapturerMac::ScreenRefresh(CGRectCount count, ScreenConfigurationChanged(); DesktopRegion region; - DesktopVector translate_vector = - DesktopVector().subtract(screen_pixel_bounds_.top_left()); for (CGRectCount i = 0; i < count; ++i) { // Convert from Density-Independent Pixel to physical pixel coordinates. DesktopRect rect = ScaleAndRoundCGRect(rect_array[i], dip_to_pixel_scale_); - // Translate from local desktop to capturer framebuffer coordinates. - rect.Translate(translate_vector); region.AddRect(rect); }