Call PrintWindow for the first time of capturing to capture the window frames correctly.
This will fix artifacts on the captured window frames, especially for cmd, which
sometimes leaks glimpss of other window's content.
BUG=
R=sergeyu@chromium.org
Review URL: https://webrtc-codereview.appspot.com/8989004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5616 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc
index d65c625..7e2859f 100644
--- a/webrtc/modules/desktop_capture/window_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/window_capturer_win.cc
@@ -217,11 +217,11 @@
// When composition is enabled the DC returned by GetWindowDC() doesn't always
// have window frame rendered correctly. Windows renders it only once and then
// caches the result between captures. We hack it around by calling
- // PrintWindow() whenever window size changes - it somehow affects what we
- // get from BitBlt() on the subsequent captures.
+ // PrintWindow() whenever window size changes, including the first time of
+ // capturing - it somehow affects what we get from BitBlt() on the subsequent
+ // captures.
- if (!IsAeroEnabled() ||
- (!previous_size_.is_empty() && !previous_size_.equals(frame->size()))) {
+ if (!IsAeroEnabled() || !previous_size_.equals(frame->size())) {
result = PrintWindow(window_, mem_dc, 0);
}