Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: re-enable WindowCaptureMacV2 #37014

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 1 addition & 11 deletions patches/chromium/desktop_media_list.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Subject: desktop_media_list.patch

* Use our grit resources instead of the chrome ones.
* Disabled WindowCaptureMacV2 feature for https://github.com/electron/electron/pull/30507
* Ensure "OnRefreshComplete()" even if there are no items in the list

diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
Expand Down Expand Up @@ -82,37 +81,28 @@
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index b548c9fbd3c0bf425447b29dcd866cd27e96b14c..f994ac6086c7b4cd3e8534f34691189d78a21601 100644
index b548c9fbd3c0bf425447b29dcd866cd27e96b14c..1e4c572deb0b20416f3fa65f7fe6d33612e3b691 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -147,7 +147,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
#if BUILDFLAG(IS_MAC)
BASE_FEATURE(kWindowCaptureMacV2,
"WindowCaptureMacV2",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
#endif

} // namespace
@@ -457,6 +457,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
FROM_HERE,
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
media_list_));
+
+ // This call is necessary to release underlying OS screen capture mechanisms.
+ capturer_.reset();
}

void NativeDesktopMediaList::Worker::OnCaptureResult(

Check failure on line 96 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 23-x-y

patches/chromium/desktop_media_list.patch#L88-L96

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -141,7 +141,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
++=======
++>>>>>>> fix: re-enable WindowCaptureMacV2
@@ -829,6 +832,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(

Check failure on line 97 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 23-x-y

patches/chromium/desktop_media_list.patch#L88-L97

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -141,7 +141,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -451,6 +451,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 97 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 24-x-y

patches/chromium/desktop_media_list.patch#L88-L97

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -147,7 +147,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -457,6 +457,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 97 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 24-x-y

patches/chromium/desktop_media_list.patch#L88-L97

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -147,7 +147,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -457,6 +457,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 97 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 27-x-y

patches/chromium/desktop_media_list.patch#L88-L97

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -147,7 +147,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -457,6 +457,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
base::Unretained(worker_.get()),
std::move(native_ids), thumbnail_size_));
+ } else {
+#if defined(USE_AURA)
+ pending_native_thumbnail_capture_ = true;
+#endif
+ UpdateNativeThumbnailsFinished();
}

Check failure on line 106 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 27-x-y

patches/chromium/desktop_media_list.patch#L88-L106

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -244,7 +244,7 @@ class NativeDesktopMediaList::Worker
 +   base::WeakPtr<NativeDesktopMediaList> media_list_;
 + 
 +   DesktopMediaList::Type type_;
 +-  const std::unique_ptr<ThumbnailCapturer> capturer_;
 ++  std::unique_ptr<ThumbnailCapturer> capturer_;
 +   const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
 +   const bool add_current_process_windows_;
 + 
 +@@ -531,6 +531,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 106 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 27-x-y

patches/chromium/desktop_media_list.patch#L88-L106

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -244,7 +244,7 @@ class NativeDesktopMediaList::Worker
 +   base::WeakPtr<NativeDesktopMediaList> media_list_;
 + 
 +   DesktopMediaList::Type type_;
 +-  const std::unique_ptr<ThumbnailCapturer> capturer_;
 ++  std::unique_ptr<ThumbnailCapturer> capturer_;
 +   const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
 +   const bool add_current_process_windows_;
 + 
 +@@ -531,6 +531,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 106 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 27-x-y

patches/chromium/desktop_media_list.patch#L88-L106

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -244,7 +244,7 @@ class NativeDesktopMediaList::Worker
 +   base::WeakPtr<NativeDesktopMediaList> media_list_;
 + 
 +   DesktopMediaList::Type type_;
 +-  const std::unique_ptr<ThumbnailCapturer> capturer_;
 ++  std::unique_ptr<ThumbnailCapturer> capturer_;
 +   const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
 +   const bool add_current_process_windows_;
 + 
 +@@ -531,6 +531,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 106 in patches/chromium/desktop_media_list.patch

View check run for this annotation

trop / Backportable? - 28-x-y

patches/chromium/desktop_media_list.patch#L88-L106

Patch Conflict
Raw output
++<<<<<<< HEAD
 +@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
 + #if BUILDFLAG(IS_MAC)
 + BASE_FEATURE(kWindowCaptureMacV2,
 +              "WindowCaptureMacV2",
 +-             base::FEATURE_ENABLED_BY_DEFAULT);
 ++             base::FEATURE_DISABLED_BY_DEFAULT);
 + #endif
 + 
 + }  // namespace
 +@@ -244,7 +244,7 @@ class NativeDesktopMediaList::Worker
 +   base::WeakPtr<NativeDesktopMediaList> media_list_;
 + 
 +   DesktopMediaList::Type type_;
 +-  const std::unique_ptr<ThumbnailCapturer> capturer_;
 ++  std::unique_ptr<ThumbnailCapturer> capturer_;
 +   const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
 +   const bool add_current_process_windows_;
 + 
 +@@ -531,6 +531,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++=======
+ @@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
++>>>>>>> fix: re-enable WindowCaptureMacV2
}

4 changes: 3 additions & 1 deletion shell/browser/api/electron_api_desktop_capturer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@
v8::Isolate* isolate,
const electron::api::DesktopCapturer::Source& source) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
content::DesktopMediaID id = source.media_list_source.id;
dict.Set("name", base::UTF16ToUTF8(source.media_list_source.name));
content::DesktopMediaID id = source.media_list_source.id;

Check failure on line 156 in shell/browser/api/electron_api_desktop_capturer.cc

View check run for this annotation

trop / Backportable? - 28-x-y

shell/browser/api/electron_api_desktop_capturer.cc#L155-L156

Patch Conflict
Raw output
++<<<<<<< HEAD
 +    auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
 +    content::DesktopMediaID id = source.media_list_source.id;
++=======
+     gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
++>>>>>>> fix: re-enable WindowCaptureMacV2
if (id.window_id == id.id)
id.window_id = content::DesktopMediaID::kNullId;
dict.Set("id", id.ToString());
dict.Set("thumbnail",
electron::api::NativeImage::Create(
Expand Down
14 changes: 2 additions & 12 deletions shell/browser/native_window_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1234,32 +1234,22 @@
gfx::NativeWindow NativeWindowMac::GetNativeWindow() const {
return window_;
}

gfx::AcceleratedWidget NativeWindowMac::GetAcceleratedWidget() const {
return [window_ windowNumber];
}

content::DesktopMediaID NativeWindowMac::GetDesktopMediaID() const {
auto desktop_media_id = content::DesktopMediaID(
content::DesktopMediaID::TYPE_WINDOW, GetAcceleratedWidget());
// c.f.
// https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/media/webrtc/native_desktop_media_list.cc;l=775-780;drc=79502ab47f61bff351426f57f576daef02b1a8dc
// Refs https://github.com/electron/electron/pull/30507
// TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
#if 0
if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
desktop_media_id.window_id = desktop_media_id.id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepak1556 we could do this, but then it would be invalid when for example passed into getUserMedia. I made this change for the same reason i did this one: https://github.com/electron/electron/pull/37014/files#diff-73f755a575b1c517f40cd8358386c43c4ffb0eff9e8a7a9ab80c5f50a248dcf4R156

}
#endif
return desktop_media_id;
return content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW,
GetAcceleratedWidget());
}

NativeWindowHandle NativeWindowMac::GetNativeWindowHandle() const {
return [window_ contentView];

Check failure on line 1248 in shell/browser/native_window_mac.mm

View check run for this annotation

trop / Backportable? - 23-x-y

shell/browser/native_window_mac.mm#L1237-L1248

Patch Conflict
Raw output
++<<<<<<< HEAD
 +  auto desktop_media_id = content::DesktopMediaID(
 +      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
 +  // Refs https://github.com/electron/electron/pull/30507
 +  // TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
 +#if 0
 +    if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
 +      desktop_media_id.window_id = desktop_media_id.id;
 +    }
 +#endif
 +  return desktop_media_id;
++=======
+   return content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW,
+                                  GetAcceleratedWidget());
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 1248 in shell/browser/native_window_mac.mm

View check run for this annotation

trop / Backportable? - 23-x-y

shell/browser/native_window_mac.mm#L1237-L1248

Patch Conflict
Raw output
++<<<<<<< HEAD
 +  auto desktop_media_id = content::DesktopMediaID(
 +      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
 +  // Refs https://github.com/electron/electron/pull/30507
 +  // TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
 +#if 0
 +    if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
 +      desktop_media_id.window_id = desktop_media_id.id;
 +    }
 +#endif
 +  return desktop_media_id;
++=======
+   return content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW,
+                                  GetAcceleratedWidget());
++>>>>>>> fix: re-enable WindowCaptureMacV2
}

void NativeWindowMac::SetProgressBar(double progress,
const NativeWindow::ProgressState state) {

Check failure on line 1252 in shell/browser/native_window_mac.mm

View check run for this annotation

trop / Backportable? - 24-x-y

shell/browser/native_window_mac.mm#L1241-L1252

Patch Conflict
Raw output
++<<<<<<< HEAD
 +  auto desktop_media_id = content::DesktopMediaID(
 +      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
 +  // Refs https://github.com/electron/electron/pull/30507
 +  // TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
 +#if 0
 +    if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
 +      desktop_media_id.window_id = desktop_media_id.id;
 +    }
 +#endif
 +  return desktop_media_id;
++=======
+   return content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW,
+                                  GetAcceleratedWidget());
++>>>>>>> fix: re-enable WindowCaptureMacV2
NSDockTile* dock_tile = [NSApp dockTile];

// Sometimes macOS would install a default contentView for dock, we must
Expand Down Expand Up @@ -1335,22 +1325,22 @@
[window_ setDisableAutoHideCursor:!auto_hide];
}

void NativeWindowMac::UpdateVibrancyRadii(bool fullscreen) {
NSVisualEffectView* vibrantView = [window_ vibrantView];

if (vibrantView != nil && !vibrancy_type_.empty()) {
const bool no_rounded_corner = !HasStyleMask(NSWindowStyleMaskTitled);
if (!has_frame() && !is_modal() && !no_rounded_corner) {
CGFloat radius;
if (fullscreen) {
radius = 0.0f;
} else if (@available(macOS 11.0, *)) {
radius = 9.0f;
} else {

Check failure on line 1339 in shell/browser/native_window_mac.mm

View check run for this annotation

trop / Backportable? - 24-x-y

shell/browser/native_window_mac.mm#L1328-L1339

Patch Conflict
Raw output
++<<<<<<< HEAD
 +  auto desktop_media_id = content::DesktopMediaID(
 +      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
 +  // Refs https://github.com/electron/electron/pull/30507
 +  // TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
 +#if 0
 +    if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
 +      desktop_media_id.window_id = desktop_media_id.id;
 +    }
 +#endif
 +  return desktop_media_id;
++=======
+   return content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW,
+                                  GetAcceleratedWidget());
++>>>>>>> fix: re-enable WindowCaptureMacV2
// Smaller corner radius on versions prior to Big Sur.
radius = 5.0f;
}

Check failure on line 1343 in shell/browser/native_window_mac.mm

View check run for this annotation

trop / Backportable? - 24-x-y

shell/browser/native_window_mac.mm#L1332-L1343

Patch Conflict
Raw output
++<<<<<<< HEAD
 +  auto desktop_media_id = content::DesktopMediaID(
 +      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
 +  // Refs https://github.com/electron/electron/pull/30507
 +  // TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
 +#if 0
 +    if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
 +      desktop_media_id.window_id = desktop_media_id.id;
 +    }
 +#endif
 +  return desktop_media_id;
++=======
+   return content::DesktopMediaID(content::DesktopMediaID::TYPE_WINDOW,
+                                  GetAcceleratedWidget());
++>>>>>>> fix: re-enable WindowCaptureMacV2
CGFloat dimension = 2 * radius + 1;
NSSize size = NSMakeSize(dimension, dimension);
NSImage* maskImage = [NSImage imageWithSize:size
Expand Down
7 changes: 6 additions & 1 deletion spec/api-desktop-capturer-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@
});

it('getSources should not incorrectly duplicate window_id', async () => {
const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
const w = new BrowserWindow({
show: false,
width: 100,
height: 100,
webPreferences: { contextIsolation: false }
});
const wShown = once(w, 'show');
const wFocused = once(w, 'focus');
w.show();
w.focus();

Check failure on line 125 in spec/api-desktop-capturer-spec.ts

View check run for this annotation

trop / Backportable? - 23-x-y

spec/api-desktop-capturer-spec.ts#L123-L125

Patch Conflict
Raw output
++<<<<<<< HEAD
 +    const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
 +    const wShown = emittedOnce(w, 'show');
 +    const wFocused = emittedOnce(w, 'focus');
++=======
+     const w = new BrowserWindow({
+       show: false,
+       width: 100,
+       height: 100,
+       webPreferences: { contextIsolation: false }
+     });
+     const wShown = once(w, 'show');
+     const wFocused = once(w, 'focus');
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 125 in spec/api-desktop-capturer-spec.ts

View check run for this annotation

trop / Backportable? - 23-x-y

spec/api-desktop-capturer-spec.ts#L123-L125

Patch Conflict
Raw output
++<<<<<<< HEAD
 +    const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
 +    const wShown = emittedOnce(w, 'show');
 +    const wFocused = emittedOnce(w, 'focus');
++=======
+     const w = new BrowserWindow({
+       show: false,
+       width: 100,
+       height: 100,
+       webPreferences: { contextIsolation: false }
+     });
+     const wShown = once(w, 'show');
+     const wFocused = once(w, 'focus');
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 125 in spec/api-desktop-capturer-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-desktop-capturer-spec.ts#L123-L125

Patch Conflict
Raw output
++<<<<<<< HEAD
 +    const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
 +    const wShown = emittedOnce(w, 'show');
 +    const wFocused = emittedOnce(w, 'focus');
++=======
+     const w = new BrowserWindow({
+       show: false,
+       width: 100,
+       height: 100,
+       webPreferences: { contextIsolation: false }
+     });
+     const wShown = once(w, 'show');
+     const wFocused = once(w, 'focus');
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 125 in spec/api-desktop-capturer-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-desktop-capturer-spec.ts#L123-L125

Patch Conflict
Raw output
++<<<<<<< HEAD
 +    const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
 +    const wShown = emittedOnce(w, 'show');
 +    const wFocused = emittedOnce(w, 'focus');
++=======
+     const w = new BrowserWindow({
+       show: false,
+       width: 100,
+       height: 100,
+       webPreferences: { contextIsolation: false }
+     });
+     const wShown = once(w, 'show');
+     const wFocused = once(w, 'focus');
++>>>>>>> fix: re-enable WindowCaptureMacV2

Check failure on line 125 in spec/api-desktop-capturer-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-desktop-capturer-spec.ts#L123-L125

Patch Conflict
Raw output
++<<<<<<< HEAD
 +    const w = new BrowserWindow({ show: false, width: 100, height: 100, webPreferences: { contextIsolation: false } });
 +    const wShown = emittedOnce(w, 'show');
 +    const wFocused = emittedOnce(w, 'focus');
++=======
+     const w = new BrowserWindow({
+       show: false,
+       width: 100,
+       height: 100,
+       webPreferences: { contextIsolation: false }
+     });
+     const wShown = once(w, 'show');
+     const wFocused = once(w, 'focus');
++>>>>>>> fix: re-enable WindowCaptureMacV2
await wShown;
await wFocused;

Expand Down