Make MainWindow closable and reopen on dock-click