macOS: add screen protection preference

Persist a macOS-only preference for disabling wx content protection while keeping protection enabled by default.

Add a Preferences checkbox that reuses IDC_DISABLE_SCREEN_PROTECTION and reapply the protection state after preference changes.

Apply content-protection updates to all current top-level wx windows so changing the preference while a modal dialog is active does not leave the main frame or other windows with stale protection state.
This commit is contained in:
Mounir IDRASSI committed 2026-06-21 14:24:20 +02:00
1 parent adac089fd6
commit e6eb1d9f57
6 files changed
+38 -2

No files matched your search

+6 -1
View File
@@ -2053,7 +2053,12 @@ namespace VeraCrypt
void GraphicUserInterface::SetContentProtection (bool enable) const
{
#if defined(TC_WINDOWS) || defined(TC_MACOSX)
GetActiveWindow()->SetContentProtection(enable ? wxCONTENT_PROTECTION_ENABLED : wxCONTENT_PROTECTION_NONE);
foreach (wxWindow *window, wxTopLevelWindows)
{
wxTopLevelWindow *topLevelWindow = dynamic_cast <wxTopLevelWindow *> (window);
if (topLevelWindow)
topLevelWindow->SetContentProtection (enable ? wxCONTENT_PROTECTION_ENABLED : wxCONTENT_PROTECTION_NONE);
}
#endif
}