customized maximize window handler