Xlib 에서 창 닫을때 받을 수 있는 이벤트 없나요?

소야의 이미지

XSelectInput에서 StructureNotifyMask써서 DestroyNotify 이벤트로 받아도 안되고
또 UnmapNotify로 해도 안되는군요 ㅠㅠ
방법좀 알려주세요