From 0174ffe70018e85681721ae2c9a82159b7c1ee0a Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Wed, 20 Nov 2019 10:04:51 -0800 Subject: [PATCH] Can list UWP applications Before the CL [1] https://webrtc-review.googlesource.com/c/src/+/144960 the UWP applications could not be captured so they were filtered out. Another reason of this previous filter was because otherwise some 'ghost windows' are listed too. These 'ghost windows' are prelaunched UWP apps whose windows are created in a hidden/cloaked state to improve perceived performance of launching these apps later, see: [2] https://docs.microsoft.com/en-us/windows/uwp/launch-resume/handle-app-prelaunch They can be filtered out using the new API merged recently 'webrtc::WindowCaptureHelperWin::IsWindowCloaked, see: [3] https://webrtc-review.googlesource.com/c/src/+/143980 This patch allows non-cloaked UWP apps to be listed by taking advantage of CL [3]. So that user can select them with the app window picker and can then share them thanks to [1]. Bug: chromium:700037 Change-Id: I4b41bb764ebbd6e2f164f036a63a4b1cd06c3f2f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160021 Reviewed-by: Jamie Walch Commit-Queue: Julien Isorce Cr-Commit-Position: refs/heads/master@{#29868} --- modules/desktop_capture/window_capturer_win.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/modules/desktop_capture/window_capturer_win.cc b/modules/desktop_capture/window_capturer_win.cc index 7258e89251..8fb2be7185 100644 --- a/modules/desktop_capture/window_capturer_win.cc +++ b/modules/desktop_capture/window_capturer_win.cc @@ -66,16 +66,6 @@ BOOL CALLBACK WindowsEnumerationHandler(HWND hwnd, LPARAM param) { if (wcscmp(class_name, L"Progman") == 0 || wcscmp(class_name, L"Button") == 0) return TRUE; - // Windows 8 introduced a "Modern App" identified by their class name being - // either ApplicationFrameWindow or windows.UI.Core.coreWindow. The - // associated windows cannot be captured, so we skip them. - // http://crbug.com/526883. - if (rtc::IsWindows8OrLater() && - (wcscmp(class_name, L"ApplicationFrameWindow") == 0 || - wcscmp(class_name, L"Windows.UI.Core.CoreWindow") == 0)) { - return TRUE; - } - DesktopCapturer::Source window; window.id = reinterpret_cast(hwnd); @@ -208,7 +198,7 @@ bool WindowCapturerWin::GetSourceList(SourceList* sources) { return false; for (auto it = result.begin(); it != result.end();) { - if (!window_capture_helper_.IsWindowOnCurrentDesktop( + if (!window_capture_helper_.IsWindowVisibleOnCurrentDesktop( reinterpret_cast(it->id))) { it = result.erase(it); } else {