Skip to content

Commit df8eb2a

Browse files
fix: setContentProtection affects BrowserWindow frame (#31831)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
1 parent 7478c82 commit df8eb2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shell/browser/native_window_views.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,8 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
11261126
void NativeWindowViews::SetContentProtection(bool enable) {
11271127
#if defined(OS_WIN)
11281128
HWND hwnd = GetAcceleratedWidget();
1129+
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
1130+
::SetWindowDisplayAffinity(hwnd, affinity);
11291131
if (!layered_) {
11301132
// Workaround to prevent black window on screen capture after hiding and
11311133
// showing the BrowserWindow.
@@ -1134,8 +1136,6 @@ void NativeWindowViews::SetContentProtection(bool enable) {
11341136
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
11351137
layered_ = true;
11361138
}
1137-
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
1138-
::SetWindowDisplayAffinity(hwnd, affinity);
11391139
#endif
11401140
}
11411141

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy