From 858fdc781ebcff70d29dd8c5ffb5a94bc3744ada Mon Sep 17 00:00:00 2001 From: Nico Grunbaum Date: Wed, 27 Oct 2021 22:25:51 +0000 Subject: [PATCH] Bug 1729367 - P0 - Temp revert of Windows pid capture to allow for clean cherry-pick;r=mjf Differential Revision: https://phabricator.services.mozilla.com/D129710 --- .../desktop_capture/win/window_capture_utils.cc | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/third_party/libwebrtc/modules/desktop_capture/win/window_capture_utils.cc b/third_party/libwebrtc/modules/desktop_capture/win/window_capture_utils.cc index 507adc29b742..7b6d553bb2f4 100644 --- a/third_party/libwebrtc/modules/desktop_capture/win/window_capture_utils.cc +++ b/third_party/libwebrtc/modules/desktop_capture/win/window_capture_utils.cc @@ -168,7 +168,6 @@ bool IsWindowValidAndVisible(HWND window) { BOOL CALLBACK FilterUncapturableWindows(HWND hwnd, LPARAM param) { DesktopCapturer::SourceList* list = reinterpret_cast(param); - // Skip windows that are invisible, minimized, have no title, or are owned, // unless they have the app window style set. int len = GetWindowTextLength(hwnd); @@ -178,7 +177,6 @@ BOOL CALLBACK FilterUncapturableWindows(HWND hwnd, LPARAM param) { (owner && !(exstyle & WS_EX_APPWINDOW))) { return TRUE; } - // Skip unresponsive windows. Set timout with 50ms, in case system is under // heavy load. We could wait longer and have a lower false negative, but that // would delay the the enumeration. @@ -187,27 +185,19 @@ BOOL CALLBACK FilterUncapturableWindows(HWND hwnd, LPARAM param) { nullptr)) { return TRUE; } - // Skip the Program Manager window and the Start button. WCHAR class_name[256]; const int class_name_length = GetClassNameW(hwnd, class_name, arraysize(class_name)); if (class_name_length < 1) return TRUE; - // Skip Program Manager window and the Start button. This is the same logic // that's used in Win32WindowPicker in libjingle. Consider filtering other // windows as well (e.g. toolbars). if (wcscmp(class_name, L"Progman") == 0 || wcscmp(class_name, L"Button") == 0) return TRUE; - DesktopCapturer::Source window; window.id = reinterpret_cast(hwnd); - - DWORD pid; - GetWindowThreadProcessId(hwnd, &pid); - window.pid = static_cast(pid); - // Truncate the title if it's longer than 500 characters. WCHAR window_title[500]; GetWindowTextW(hwnd, window_title, arraysize(window_title)); @@ -216,9 +206,7 @@ BOOL CALLBACK FilterUncapturableWindows(HWND hwnd, LPARAM param) { // Skip windows when we failed to convert the title or it is empty. if (window.title.empty()) return TRUE; - list->push_back(window); - return TRUE; }