Fix window not closing when clicking empty space