Change the default behavior when closing a window.