Want - DoubleClick on Tray Icon - Appears/Disappears Main Window

Now we have appearing main window and to close it we have to click “x” button.
It would be nice to have ability to close main window by clicking on tray icon also as some another applications .
Is it possible ?