Reset UI state when closing window by ESC key