Adding destroy-event signal to the top-level window