chore: remove deprecated systemPreferences.isAeroGlassEnabled()
(#45563)
This commit is contained in:
parent
670e0ca076
commit
22b7403cd1
5 changed files with 11 additions and 26 deletions
|
@ -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
|
||||
|
|
|
@ -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`
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue