From 22b7403cd1beb2aa95bec223ddd6f328c18b7f8c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 19 Feb 2025 01:59:00 +0100 Subject: [PATCH] chore: remove deprecated `systemPreferences.isAeroGlassEnabled()` (#45563) --- docs/api/system-preferences.md | 10 ---------- docs/breaking-changes.md | 9 +++++++++ lib/browser/api/system-preferences.ts | 8 -------- spec/api-system-preferences-spec.ts | 8 -------- spec/ts-smoke/electron/main.ts | 2 ++ 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/docs/api/system-preferences.md b/docs/api/system-preferences.md index 05e83be870b4..3a6488274eeb 100644 --- a/docs/api/system-preferences.md +++ b/docs/api/system-preferences.md @@ -181,16 +181,6 @@ Some popular `key` and `type`s are: Removes the `key` in `NSUserDefaults`. This can be used to restore the default or global value of a `key` previously set with `setUserDefault`. -### `systemPreferences.isAeroGlassEnabled()` _Windows_ _Deprecated_ - -Returns `boolean` - `true` if [DWM composition][dwm-composition] (Aero Glass) is -enabled, and `false` otherwise. - -**Deprecated:** -This function has been always returning `true` since Electron 23, which only supports Windows 10+. - -[dwm-composition]: https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw - ### `systemPreferences.getAccentColor()` _Windows_ _macOS_ Returns `string` - The users current system wide accent color preference in RGBA diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 15a74912babd..061ce6d28763 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -12,6 +12,15 @@ This document uses the following convention to categorize breaking changes: * **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release. * **Removed:** An API or feature was removed, and is no longer supported by Electron. +## Planned Breaking API Changes (36.0) + +### Removed: `systemPreferences.isAeroGlassEnabled()` + +The `systemPreferences.isAeroGlassEnabled()` function has been removed without replacement. +It has been always returning `true` since Electron 23, which only supports Windows 10+, where DWM composition can no longer be disabled. + +https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw#disabling-dwm-composition-windows7-and-earlier + ## Planned Breaking API Changes (35.0) ### Removed:`isDefault` and `status` properties on `PrinterInfo` diff --git a/lib/browser/api/system-preferences.ts b/lib/browser/api/system-preferences.ts index 3f78083d02b2..b5485a7361a6 100644 --- a/lib/browser/api/system-preferences.ts +++ b/lib/browser/api/system-preferences.ts @@ -20,12 +20,4 @@ if ('accessibilityDisplayShouldReduceTransparency' in systemPreferences) { }); } -if (process.platform === 'win32') { - const isAeroGlassEnabledDeprecated = deprecate.warnOnce('systemPreferences.isAeroGlassEnabled'); - systemPreferences.isAeroGlassEnabled = () => { - isAeroGlassEnabledDeprecated(); - return true; - }; -} - export default systemPreferences; diff --git a/spec/api-system-preferences-spec.ts b/spec/api-system-preferences-spec.ts index 44637669f24c..05de0b91e856 100644 --- a/spec/api-system-preferences-spec.ts +++ b/spec/api-system-preferences-spec.ts @@ -2,7 +2,6 @@ import { systemPreferences } from 'electron/main'; import { expect } from 'chai'; -import { expectDeprecationMessages } from './lib/deprecate-helpers'; import { ifdescribe } from './lib/spec-helpers'; describe('systemPreferences module', () => { @@ -60,13 +59,6 @@ describe('systemPreferences module', () => { }); }); - ifdescribe(process.platform === 'win32')('systemPreferences.isAeroGlassEnabled()', () => { - it('always returns true', () => { - expect(systemPreferences.isAeroGlassEnabled()).to.equal(true); - expectDeprecationMessages(() => systemPreferences.isAeroGlassEnabled(), '\'systemPreferences.isAeroGlassEnabled\' is deprecated and will be removed.'); - }); - }); - ifdescribe(process.platform === 'darwin')('systemPreferences.getUserDefault(key, type)', () => { it('returns values for known user defaults', () => { const locale = systemPreferences.getUserDefault('AppleLocale', 'string'); diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index 4dfef7df74af..62f272697071 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -370,6 +370,8 @@ if (process.platform === 'win32') { // @ts-expect-error Removed API systemPreferences.on('high-contrast-color-scheme-changed', (_, highContrast) => console.log(highContrast ? 'high contrast' : 'not high contrast')); console.log('Color for menu is', systemPreferences.getColor('menu')); + // @ts-expect-error Removed API + systemPreferences.isAeroGlassEnabled(); } if (process.platform === 'darwin') {