diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 1727e1f53a3c..c0c63673a32b 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1734,7 +1734,9 @@ events. Prevents the window contents from being captured by other apps. On macOS it sets the NSWindow's sharingType to NSWindowSharingNone. -On Windows it calls SetWindowDisplayAffinity with `WDA_MONITOR`. +On Windows it calls SetWindowDisplayAffinity with `WDA_EXCLUDEFROMCAPTURE`. +For Windows 10 version 2004 and up the window will be removed from capture entirely, +older Windows versions behave as if `WDA_MONITOR` is applied capturing a black window. #### `win.setFocusable(focusable)` _macOS_ _Windows_ diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 31fa04d56ffd..898c28d399f1 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -1003,7 +1003,7 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) { void NativeWindowViews::SetContentProtection(bool enable) { #if defined(OS_WIN) - DWORD affinity = enable ? WDA_MONITOR : WDA_NONE; + DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE; ::SetWindowDisplayAffinity(GetAcceleratedWidget(), affinity); #endif }