-
Notifications
You must be signed in to change notification settings - Fork 16.2k
Closed
Description
Hi,
I build a menubar app and use Tray to display window below menubar item.
I use the following implementation:
https://github.com/kevinsawicki/tray-example
When user clicks on menubar item it highlights, i.e.:
tray.on('right-click', toggleWindow);
tray.on('double-click', toggleWindow);
tray.on('click', toggleWindow);
window.on('show', () => {
tray.setHighlightMode('always');
});
window.on('hide', () => {
tray.setHighlightMode('never');
});
However if user switches between menubar items the tray item remains selected which is against how things are naturally handled on macOS. On macOS the majority of apps hide the corresponsding menus or popovers when other menubar item is being selected. I am sure that holds true for Windows as well.
Also since I am not able to track when that happens, there is nothing I can do to hide the displayed window.
The proposal is to have an event or certain capability to track when user switches between menubar items.
- Electron version: 1.5.0
- Operating system: macOS