diff --git a/Cartfile.resolved b/Cartfile.resolved index 8b9548f8..070f21b1 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -2,4 +2,4 @@ binary "https://sparkle-project.org/Carthage/Sparkle.json" "2.6.4" github "MacPass/KeePassKit" "3.3.2" github "MacPass/KissXML" "503fc012b73a4507965019720cbf1c157e849657" github "MacPass/TransformerKit" "3232b04c568df7f98b33ceb21a2090a9ccbc2065" -github "mstarke/HNHUi" "6.0.1" \ No newline at end of file +github "mstarke/HNHUi" "6.0.1" diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index 867cdccb..fdea245a 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -100,6 +100,14 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword); [super windowDidLoad]; self.window.delegate = self.documentWindowDelegate; + BOOL allowScreenshots = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyAllowScreenshots]; + if(!allowScreenshots) { + self.window.sharingType = NSWindowSharingNone; + } + else { + self.window.sharingType = NSWindowSharingReadOnly; + } + if (@available(macOS 11.0, *)) { /* let the user decide how to dipsplay the toolbar */ BOOL useUnifiedToolbar = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyUseUnifiedToolbar]; diff --git a/MacPass/MPSettingsHelper.h b/MacPass/MPSettingsHelper.h index 0704732e..64e8a8d4 100644 --- a/MacPass/MPSettingsHelper.h +++ b/MacPass/MPSettingsHelper.h @@ -105,6 +105,7 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyFaviconDownloadMethod; /* UI */ APPKIT_EXTERN NSString *const kMPSettingsKeyUseUnifiedToolbar; +APPKIT_EXTERN NSString *const kMPSettingsKeyAllowScreenshots; typedef NS_ENUM(NSUInteger, MPFileChangeStrategy) { MPFileChangeStrategyAsk, diff --git a/MacPass/MPSettingsHelper.m b/MacPass/MPSettingsHelper.m index a36928a5..fb4d4141 100644 --- a/MacPass/MPSettingsHelper.m +++ b/MacPass/MPSettingsHelper.m @@ -101,6 +101,7 @@ NSString *const kMPSettingsKeyAllowRemoteFetchOfPluginRepository NSString *const kMPSettingsKeyFaviconDownloadMethod = @"FaviconDownloadMethod"; NSString *const kMPSettingsKeyUseUnifiedToolbar = @"UseUnifiedToolbar"; +NSString *const kMPSettingsKeyAllowScreenshots = @"AllowScreenshots"; /* Deprecated */ NSString *const kMPDeprecatedSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases"; @@ -186,6 +187,7 @@ NSString *const kMPDepricatedSettingsKeyEntryTouchIdDatabaseEncryptedKeyFormat kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO, kMPSettingsKeyUseUnifiedToolbar: @YES, // Do not use unified toolbar under Big Sur and above + kMPSettingsKeyAllowScreenshots: @NO, // Do not allow screenshots or screen recordings of MacPass kMPSettingsKeyFocusSearchAfterUnlock: @NO, // Do not enter search directly after unlocking the database kMPSettingsKeyUsePrivateBrowsingWhenOpeningURLs: @NO // No private mode when option URLs by default };