Skip to content

Commit c804d63

Browse files
fix: setContentProtection affects BrowserWindow frame (#31829)
Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
1 parent 2ee43f9 commit c804d63

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
@@ -1109,6 +1109,8 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
11091109
void NativeWindowViews::SetContentProtection(bool enable) {
11101110
#if defined(OS_WIN)
11111111
HWND hwnd = GetAcceleratedWidget();
1112+
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
1113+
::SetWindowDisplayAffinity(hwnd, affinity);
11121114
if (!layered_) {
11131115
// Workaround to prevent black window on screen capture after hiding and
11141116
// showing the BrowserWindow.
@@ -1117,8 +1119,6 @@ void NativeWindowViews::SetContentProtection(bool enable) {
11171119
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
11181120
layered_ = true;
11191121
}
1120-
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
1121-
::SetWindowDisplayAffinity(hwnd, affinity);
11221122
#endif
11231123
}
11241124

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