From bdb8df895a157bb3b9419c63c22ada41cfba641d Mon Sep 17 00:00:00 2001 From: zijiehe Date: Thu, 20 Oct 2016 16:44:17 -0700 Subject: [PATCH] BringSelectedWindowToFront should bring the window to front instead of only focusing it The API is misused, please refer to the bug for detail explanation. BUG=https://bugs.chromium.org/p/webrtc/issues/detail?id=6565 Review-Url: https://codereview.webrtc.org/2426423005 Cr-Commit-Position: refs/heads/master@{#14715} --- webrtc/modules/desktop_capture/window_capturer_win.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/desktop_capture/window_capturer_win.cc b/webrtc/modules/desktop_capture/window_capturer_win.cc index 61de06cc93..91ccc38f54 100644 --- a/webrtc/modules/desktop_capture/window_capturer_win.cc +++ b/webrtc/modules/desktop_capture/window_capturer_win.cc @@ -150,7 +150,8 @@ bool WindowCapturerWin::BringSelectedWindowToFront() { if (!IsWindow(window_) || !IsWindowVisible(window_) || IsIconic(window_)) return false; - return SetForegroundWindow(window_) != 0; + return BringWindowToTop(window_) != FALSE && + SetForegroundWindow(window_) != FALSE; } void WindowCapturerWin::Start(Callback* callback) {