fix hanging max window after theme change