From 5ec4a49b1c420ef2c3ef537347fc4599e63d9c24 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Tue, 17 Aug 2021 16:17:45 -0400 Subject: [PATCH] 3069272: Disable kDesktopCaptureMacV2 https://chromium-review.googlesource.com/c/chromium/src/+/3069272 --- shell/browser/feature_list.cc | 6 ------ shell/browser/native_window_mac.mm | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/shell/browser/feature_list.cc b/shell/browser/feature_list.cc index 8a488a08294c3..366eec41403f4 100644 --- a/shell/browser/feature_list.cc +++ b/shell/browser/feature_list.cc @@ -48,12 +48,6 @@ void InitializeFeatureList() { // an empty suggestions list to be returned disable_features += std::string(",") + spellcheck::kWinRetrieveSuggestionsOnlyOnDemand.name; -#endif -#if defined(OS_MAC) - // Disable kWindowCaptureMacV2, which causes the wrong window id to - // be returned (this has been disabled in upstream Chromium here): - // https://chromium-review.googlesource.com/c/chromium/src/+/3069272 - disable_features += std::string(",") + features::kWindowCaptureMacV2.name; #endif base::FeatureList::InitializeInstance(enable_features, disable_features); } diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 9fdc15144d2e6..a5c89ac4348bc 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -258,6 +258,9 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { } // namespace +const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2", + base::FEATURE_DISABLED_BY_DEFAULT}; + NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options, NativeWindow* parent) : NativeWindow(options, parent), root_view_(new RootViewMac(this)) { @@ -1256,7 +1259,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { content::DesktopMediaID::TYPE_WINDOW, GetAcceleratedWidget()); // c.f. // https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/media/webrtc/native_desktop_media_list.cc;l=372?q=kWindowCaptureMacV2&ss=chromium - if (base::FeatureList::IsEnabled(features::kWindowCaptureMacV2)) { + if (base::FeatureList::IsEnabled(kWindowCaptureMacV2)) { if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) { desktop_media_id.window_id = desktop_media_id.id; }