Show the main window on launch if hide-when-inactive is disabled
When coupled with the show dock icon option this provides a more
consistent launch experience - the main window appears at the same time
the icon is shown in the dock.
Only close on cancel if hide-when-inactive is enabled
The cancel action does not typically close windows for a regular app.
Reopen the main window for dock icon click or relaunch
Looks great, thanks!