Compare commits

...

1 Commits

Author SHA1 Message Date
Shelley Vohr
49e97a05d4 fix: WIN11_22H2 also needs layered protection 2025-08-25 10:27:42 +02:00

View File

@@ -179,11 +179,11 @@ void ElectronDesktopWindowTreeHostWin::UpdateAllowScreenshots() {
// On some older Windows versions, setting the display affinity
// to WDA_EXCLUDEFROMCAPTURE won't prevent the window from being
// captured - setting WS_EX_LAYERED mitigates this issue.
if (base::win::GetVersion() < base::win::Version::WIN11_22H2)
native_window_view_->SetLayered();
::SetWindowDisplayAffinity(
GetAcceleratedWidget(),
allow_screenshots_ ? WDA_NONE : WDA_EXCLUDEFROMCAPTURE);
if (base::win::GetVersion() <= base::win::Version::WIN11_22H2)
native_window_view_->SetLayered();
}
void ElectronDesktopWindowTreeHostWin::OnNativeThemeUpdated(