From afacca252e21804a4351570de7a7e879c95b5753 Mon Sep 17 00:00:00 2001 From: Destan Sarpkaya Date: Tue, 16 Feb 2016 16:24:05 +0200 Subject: [PATCH] add a new platform definition for linux On Linux in order for changes made to individual `MenuItem`s to take effect, you have to call `setContextMenu` again Regarding https://github.com/atom/electron/issues/1473 --- docs/api/tray.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/tray.md b/docs/api/tray.md index 08a4363..3d6f94a 100644 --- a/docs/api/tray.md +++ b/docs/api/tray.md @@ -32,6 +32,12 @@ __Platform limitations:__ install `libappindicator1` to make the tray icon work. * App indicator will only be shown when it has a context menu. * When app indicator is used on Linux, the `click` event is ignored. +* On Linux in order for changes made to individual `MenuItem`s to take effect, you have to call `setContextMenu` again. For example: + +```javascript +appIcon.menu.items[2].checked = false; +appIcon.setContextMenu(trayIcon.menu); +``` If you want to keep exact same behaviors on all platforms, you should not rely on the `click` event and always attach a context menu to the tray icon. -- 2.7.4