From 9ec5da67f0d529eca0185acebcbb3ef6895c668f Mon Sep 17 00:00:00 2001 From: Zijie He Date: Thu, 7 Sep 2017 06:53:59 -0700 Subject: [PATCH] Wrong coordinate is used in ScreenCapturerWinGdi Wrong coordinate is used in ScreenCapturerWinGdi in change https://chromium-review.googlesource.com/c/external/webrtc/+/644787 Bug: webrtc:7950 Change-Id: I8a11a4cedc594ce9c5462578e59b4e31b8c79253 Reviewed-on: https://chromium-review.googlesource.com/655257 Reviewed-by: Jamie Walch Commit-Queue: Zijie He Cr-Commit-Position: refs/heads/master@{#19734} --- webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc index b342e9faeb..10e3ca4344 100644 --- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc +++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc @@ -195,7 +195,8 @@ bool ScreenCapturerWinGdi::CaptureImage() { return false; queue_.ReplaceCurrentFrame(SharedDesktopFrame::Wrap(std::move(buffer))); } - queue_.current_frame()->set_top_left(screen_rect.top_left()); + queue_.current_frame()->set_top_left( + screen_rect.top_left().subtract(GetFullscreenRect().top_left())); // Select the target bitmap into the memory dc and copy the rect from desktop // to memory.