fix window minimize bug