diff --git a/docs/api/breaking-changes.md b/docs/api/breaking-changes.md index cb9c220a3a..57c0afedff 100644 --- a/docs/api/breaking-changes.md +++ b/docs/api/breaking-changes.md @@ -152,6 +152,17 @@ app.enableMixedSandbox() Mixed-sandbox mode is now enabled by default. +### `Tray` + +Under macOS Catalina our former Tray implementation breaks. +Apple's native substitute doesn't support changing the highlighting behavior. + +```js +// Deprecated +tray.setHighlightMode(mode) +// API will be removed in v7.0 without replacement. +``` + ## Planned Breaking API Changes (5.0) ### `new BrowserWindow({ webPreferences })` diff --git a/docs/api/tray.md b/docs/api/tray.md index 79e7c2f206..0452a83ce7 100644 --- a/docs/api/tray.md +++ b/docs/api/tray.md @@ -216,6 +216,8 @@ Returns `String` - the title displayed next to the tray icon in the status bar Sets when the tray's icon background becomes highlighted (in blue). +**[Deprecated](breaking-changes.md#tray)** + **Note:** You can use `highlightMode` with a [`BrowserWindow`](browser-window.md) by toggling between `'never'` and `'always'` modes when the window visibility changes. diff --git a/lib/browser/api/tray.js b/lib/browser/api/tray.js index e86ace77ae..135923d248 100644 --- a/lib/browser/api/tray.js +++ b/lib/browser/api/tray.js @@ -1,8 +1,12 @@ 'use strict' const { EventEmitter } = require('events') +const { deprecate } = require('electron') const { Tray } = process.electronBinding('tray') Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype) +// Deprecations +Tray.prototype.setHighlightMode = deprecate.removeFunction(Tray.prototype.setHighlightMode, 'setHighlightMode') + module.exports = Tray