Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: webrtc/modules/desktop_capture/win/window_capture_utils.cc

Issue 2973853002: desktop_capture: crop border in window_capture on Win8/10 (Closed)
Patch Set: address comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/win/window_capture_utils.cc
diff --git a/webrtc/modules/desktop_capture/win/window_capture_utils.cc b/webrtc/modules/desktop_capture/win/window_capture_utils.cc
index 83922ea7f806e2b8eb0f916e48d70f68a1af7342..41c48224e8922352d83ad8c8b80cbc8bdb0e5c7f 100644
--- a/webrtc/modules/desktop_capture/win/window_capture_utils.cc
+++ b/webrtc/modules/desktop_capture/win/window_capture_utils.cc
@@ -10,6 +10,8 @@
#include "webrtc/modules/desktop_capture/win/window_capture_utils.h"
+#include "webrtc/rtc_base/win32.h"
+
namespace webrtc {
bool
@@ -29,7 +31,11 @@ GetCroppedWindowRect(HWND window,
*original_rect = DesktopRect::MakeLTRB(
rect.left, rect.top, rect.right, rect.bottom);
- if (window_placement.showCmd == SW_SHOWMAXIMIZED) {
+ // After Windows8, transparent borders will be added by OS at
+ // left/bottom/right sides of a window. If the cropped window
+ // doesn't remove these borders, the background will be exposed a bit.
+ if (rtc::IsWindows8OrLater() ||
+ window_placement.showCmd == SW_SHOWMAXIMIZED) {
DesktopSize border = DesktopSize(GetSystemMetrics(SM_CXSIZEFRAME),
GetSystemMetrics(SM_CYSIZEFRAME));
*cropped_rect = DesktopRect::MakeLTRB(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698