Close the window if the user clicks the mouse.