window: add #close

honestly I don't remember where I got the codez, probably some stack overflow answer…