Scope down content protection to Windows 11

This commit is contained in:
Fedor Indutny
2025-05-13 11:12:08 -07:00
committed by GitHub
parent a8123f157e
commit e8e6695ec6
3 changed files with 17 additions and 2 deletions

View File

@@ -89,6 +89,7 @@ import {
import {
getDefaultSystemTraySetting,
isSystemTraySupported,
isContentProtectionEnabledByDefault,
} from '../ts/types/Settings';
import * as ephemeralConfig from './ephemeral_config';
import * as logging from '../ts/logging/main_process_logging';
@@ -574,7 +575,10 @@ async function handleCommonWindowEvents(window: BrowserWindow) {
const contentProtection = ephemeralConfig.get('contentProtection');
// Apply content protection by default on Windows, unless explicitly disabled
// by user in settings.
if (contentProtection ?? OS.isWindows()) {
if (
contentProtection ??
isContentProtectionEnabledByDefault(OS, os.release())
) {
window.once('ready-to-show', async () => {
window.setContentProtection(true);
});

View File

@@ -76,3 +76,9 @@ export const shouldHideExpiringMessageBody = (
OS: OSType,
release: string
): boolean => OS.isWindows() || (OS.isMacOS() && semver.lt(release, '21.1.0'));
// Windows 11 and forward
export const isContentProtectionEnabledByDefault = (
OS: OSType,
release: string
): boolean => OS.isWindows() && semver.gte(release, '10.0.22000');

View File

@@ -324,7 +324,12 @@ async function renderPreferences() {
hasAutoLaunch,
hasCallNotifications,
hasCallRingtoneNotification,
hasContentProtection,
hasContentProtection:
hasContentProtection ??
Settings.isContentProtectionEnabledByDefault(
OS,
MinimalSignalContext.config.osRelease
),
hasCountMutedConversations,
hasHideMenuBar,
hasIncomingCallNotifications,