Autoclose window