mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-05 16:46:35 -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:
6 files changed
+38
-2
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user