Description of bug
opening many system tray icon instead of just one!
To reproduce
File -> SettingSetting tab.General section you see Show Franz in system trayExpected behaviour
To have only one system tray icon when activating it
What really happens
It will add an icon every time you activate but will not remove it when deactivated
Screen shot

Desktop
Additional info
Only last created icon works (can show Franz or make it exit)
This issue seems to affect many Electron applications running on Linux with GNOME. A temporary workaround for GNOME users is to press 'alt+F2' and then enter 'r' to restart GNOME.
See https://github.com/electron/electron/issues/17622
I'm aware of that, but isn't there a way to have consistency for that tray.destroy even on GNOME and KDE desktops?
By the way thanks for referencing this issue there, they may make more progress by checking this too.
I'm not sure, since I don't have much expertise with Electron and/or GNOME and KDE.
No progress. Instead of using tray in electron, I tried using kde鈥檚 tray service directly via D-Bus, destroying the process which holds the tray every time I need to update the tray, and , fortunately it works, though this solution make change of tray not smooth at all, you will see the tray blinking . Actually, this bug is not caused by desktop itself.
Refer this question https://stackoverflow.com/q/23458215/8618856
It seems that I found a bug in tray implementation.
When JavaScript api is called , the call will pass to this function to do the exact job , but as you can see, it just create a new tray without destroying the previous one , which may cause the issue.
@chfanghr brilliant job, did you try to fix this?
I don鈥檛 know how to, because I cannot find the _icon variable . Perhaps it鈥檚 generated on runtime in linux_ui/... ??? I can not even find the header. That鈥檚 quite confusing . I am not familiar with electron鈥檚 build system indeed.
me too, I tried to solve it but I didn't understand it correctly, though we can inform electron community core developer they can figure it out something
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
It seems that I found a bug in tray implementation.
https://github.com/electron/electron/blob/e7c48922e77b0043f2d829b4e8c44c0d2b45d500/atom/browser/ui/tray_icon_gtk.cc#L20
When JavaScript api is called , the call will pass to this function to do the exact job , but as you can see, it just create a new tray without destroying the previous one , which may cause the issue.