Control main window visibility via VisibilityManager, quit when main window is closed.