Standard for using the system tray?

I'm building an application which will be "running in the system tray" (an icon will be shown there) and a menu will be shown when the user clicks on the icon

When I look at different applications I can see that there is a difference in how they use the system tray, in two respects:

1. Menu

Menus are shown on right click for some applications, and on left click for others

menu

2. Minimizing to tray

Some Applications are minimized to tray when clicking on "x"/"close" (in the upper right corner normally), while others are minimized to tray when the user pressed the "minimize" button

close and minimize


Question: Is there a standard for how to handle the system tray?

The application that I'm working on is cross-platform (Gnome, KDE, Windows, MacOS) and uses Qt

Grateful for help!

These other questions bring up minimize to tray behavior: