Skip to content

Commit

Permalink
3069272: Disable kDesktopCaptureMacV2
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed Aug 17, 2021
1 parent 4fd18be commit 5ec4a49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 0 additions & 6 deletions shell/browser/feature_list.cc
Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion shell/browser/native_window_mac.mm
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 5ec4a49

Please sign in to comment.