Let user choose preference on first window close
Instead of having defaults what to do on closing the main window, show a dialog with all options and a checkbox to save that preference, when first closing the window.
This allows us to accommodate all Desktop Environments, some of them may have no trayicon, some of them have.
Because there is no good way to discover that, lets simply ask the user.