webrtc/webrtc/modules/desktop_capture/win/window_capture_utils.h
jiayl@webrtc.org c8ac17ca04 Adjust the captured window rect when the window is maximized.
GetWindowRect includes the window frames for maximized window even they are off screen, causing content outside the window being captured falsely. The fix is to remove the left/right/bottom window frame from the captured rect. Mouse capturing is adjusted accordingly as well.

BUG=3076
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/10149004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5732 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-03-20 00:06:41 +00:00

26 lines
968 B
C++

/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <windows.h>
#include "webrtc/modules/desktop_capture/desktop_geometry.h"
namespace webrtc {
// Output the window rect, with the left/right/bottom frame border cropped if
// the window is maximized. |cropped_rect| is the cropped rect relative to the
// desktop. |original_rect| is the original rect returned from GetWindowRect.
// Returns true if all API calls succeeded.
bool GetCroppedWindowRect(HWND window,
DesktopRect* cropped_rect,
DesktopRect* original_rect);
} // namespace webrtc