There are things which you can mount close to the windows so that they are secure when they are open on top (Katzenschutz für Kippfenster). I have them here.
http://www.zooplus.de/shop/katzen/ba...terschutz/7381
But if it's really hot (and I am sleeping under the roof as well)- the last thing you need is a furrpurrson sleeping close to you