I'm just doing some basic XWindows programming, but not using any wrapper libraries (GTK, motif, QT, etc). Anyway, I can't seem to get a window close request event when I use the close button by the caption (the upper right 'X' button). In Windows you get the WM_DESTROY event, but from what I can see in XWindows I don't get anything. Based on what I've read I expected the CloseNotify event but XGetNextEvent() doesn't give anything.

My guess is that the event should come from the window manager. If I'm not mistaken its the one that provides the caption and the close button. I was under the impression that by calling XSetWMProperties() everything should be kosher between my window and the manager. Is there something else that is required to recieve some sort of close window event? Thanks for any help.