Skip to content

Commit

Permalink
fix: setContentProtection affects BrowserWindow frame (#31829)
Browse files Browse the repository at this point in the history
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
  • Loading branch information
trop[bot] and deermichel committed Nov 17, 2021
1 parent 2ee43f9 commit c804d63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shell/browser/native_window_views.cc
Expand Up @@ -1109,6 +1109,8 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
void NativeWindowViews::SetContentProtection(bool enable) {
#if defined(OS_WIN)
HWND hwnd = GetAcceleratedWidget();
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
::SetWindowDisplayAffinity(hwnd, affinity);
if (!layered_) {
// Workaround to prevent black window on screen capture after hiding and
// showing the BrowserWindow.
Expand All @@ -1117,8 +1119,6 @@ void NativeWindowViews::SetContentProtection(bool enable) {
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
layered_ = true;
}
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
::SetWindowDisplayAffinity(hwnd, affinity);
#endif
}

Expand Down

0 comments on commit c804d63

Please sign in to comment.