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
2026-06-21 14:24:20 +02:00
parent adac089fd6
commit e6eb1d9f57
6 changed files with 38 additions and 2 deletions
+6 -1
View File
@@ -479,7 +479,11 @@ namespace VeraCrypt
void MainFrame::InitWindowPrivacy ()
{
Gui->SetContentProtection(!CmdLine->ArgAllowScreencapture);
bool enableContentProtection = !CmdLine->ArgAllowScreencapture;
#ifdef TC_MACOSX
enableContentProtection = enableContentProtection && !GetPreferences().DisableScreenProtection;
#endif
Gui->SetContentProtection (enableContentProtection);
}
void MainFrame::InitPreferences ()
@@ -1296,6 +1300,7 @@ namespace VeraCrypt
if (Gui->IsInBackgroundMode() && !prefs.BackgroundTaskEnabled)
Close (true);
InitWindowPrivacy();
SavePreferences();
}