commit 0f9a13098424f80acc70a7ce83ad7fb15178ccb0 parent 2d3470d2ac41d616ea9c06e6c7ebb8b7108b9a92 Author: Michael Froman <mfroman@mozilla.com> Date: Thu, 9 Oct 2025 14:55:59 -0500 Bug 1993083 - Vendor libwebrtc from 83ef3450a4 Upstream commit: https://webrtc.googlesource.com/src/+/83ef3450a48a60122b68855d6ad70c1cd0d9a895 Verify enumeration before swapping window list This is to fix a bug where repeated enumerations sometimes are not correct and inconsistent even without any changes in the active windows. Bug: chromium:409473386 Change-Id: I9a56193509b478840fcb74803e4663b776198d30 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/400740 Commit-Queue: Palak Agarwal <agpalak@google.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45166} Diffstat:
| M | third_party/libwebrtc/README.mozilla.last-vendor | | | 4 | ++-- |
| M | third_party/libwebrtc/modules/desktop_capture/full_screen_window_detector.cc | | | 21 | ++++++++++++++++++++- |
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T19:54:30.440311+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T19:55:51.256342+00:00. # base of lastest vendoring -78fc106e80 +83ef3450a4 diff --git a/third_party/libwebrtc/modules/desktop_capture/full_screen_window_detector.cc b/third_party/libwebrtc/modules/desktop_capture/full_screen_window_detector.cc @@ -71,7 +71,26 @@ void FullScreenWindowDetector::UpdateWindowListIfNeeded( DesktopCapturer::SourceList window_list; if (get_sources(&window_list)) { last_update_time_ms_ = TimeMillis(); - window_list_.swap(window_list); + + bool should_swap_windows = true; +#if defined(WEBRTC_WIN) + bool is_original_source_window_alive = + ::IsWindow(reinterpret_cast<HWND>(original_source_id)); + bool is_original_source_enumerated = false; + for (auto& source : window_list) { + if (source.id == original_source_id) { + is_original_source_enumerated = true; + break; + } + } + // Don't swap window list if there is a mismatch between original window's + // state and its enumerated state. + should_swap_windows = + (is_original_source_enumerated == is_original_source_window_alive); +#endif + if (should_swap_windows) { + window_list_.swap(window_list); + } } }