Fix bug when d&d window close button