fix: setContentProtection affects BrowserWindow frame (#31768)
This commit is contained in:
parent
7e328c4b87
commit
d4abb6fb66
1 changed files with 2 additions and 2 deletions
|
@ -1108,6 +1108,8 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
|
||||||
void NativeWindowViews::SetContentProtection(bool enable) {
|
void NativeWindowViews::SetContentProtection(bool enable) {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
HWND hwnd = GetAcceleratedWidget();
|
HWND hwnd = GetAcceleratedWidget();
|
||||||
|
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
|
||||||
|
::SetWindowDisplayAffinity(hwnd, affinity);
|
||||||
if (!layered_) {
|
if (!layered_) {
|
||||||
// Workaround to prevent black window on screen capture after hiding and
|
// Workaround to prevent black window on screen capture after hiding and
|
||||||
// showing the BrowserWindow.
|
// showing the BrowserWindow.
|
||||||
|
@ -1116,8 +1118,6 @@ void NativeWindowViews::SetContentProtection(bool enable) {
|
||||||
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
|
::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
|
||||||
layered_ = true;
|
layered_ = true;
|
||||||
}
|
}
|
||||||
DWORD affinity = enable ? WDA_EXCLUDEFROMCAPTURE : WDA_NONE;
|
|
||||||
::SetWindowDisplayAffinity(hwnd, affinity);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue