mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-08-22 12:08:54 -05:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user