Fix a cursor capturing issue on Windows.
The input position to WindowFromPoint should be relative to the desktop, not relative to the window; if the result from WindowFromPoint is a child window of the shared top window, it should be captured. BUG= R=sergeyu@chromium.org Review URL: https://webrtc-codereview.appspot.com/7959004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5487 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
0e5a2b5de6
commit
20a60ea39d
@ -105,9 +105,12 @@ void MouseCursorMonitorWin::Capture() {
|
||||
position.set(0, 0);
|
||||
inside = false;
|
||||
} else {
|
||||
if (inside) {
|
||||
HWND windowUnderCursor = WindowFromPoint(cursor_info.ptScreenPos);
|
||||
inside = windowUnderCursor ?
|
||||
(window_ == GetAncestor(windowUnderCursor, GA_ROOT)) : false;
|
||||
}
|
||||
position = position.subtract(DesktopVector(rect.left, rect.top));
|
||||
if (inside)
|
||||
inside = (window_ == WindowFromPoint(cursor_info.ptScreenPos));
|
||||
}
|
||||
} else {
|
||||
assert(screen_ != kInvalidScreenId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user