fixed a bug when autoresizing

fixed bug on mac version when pressing green maximize button