Can not find any reference on how to close application by the "X" button. I'm programming using XCB and want to close the program by the "X" button. I looked and can't find anything about it. I know how to close by pressing a button. Also, by pressing the "X" button the window looks like it closes but doesn't.
How to exit program with close button in XCB
I struggled on this topic some time ago as well.
Look at http://marc.info/?l=freedesktop-xcb&m=129381953404497 .
The key is to store the cookie for the WM_DELETE_WINDOW in a separate cookie...
xcb_intern_atom_cookie_t cookie2 = xcb_intern_atom(c, 0, 16, "WM_DELETE_WINDOW");
xcb_intern_atom_reply_t* reply2 = xcb_intern_atom_reply(c, cookie2, 0);
and in the event loop compare the client_message with the cookie2
case XCB_CLIENT_MESSAGE:
{
if((*(xcb_client_message_event_t*)event).data.data32[0] == (*reply2).atom) ...
}
well, it might help someone else. ;-) –
Aquaplane
It did just help someone else. SO is the first hit on Google, although it does lead to an irrelevant page because the spider saw the question in the "Related" sidebar. –
Orbicular
Hey, that's fine! I often found good solutions here. Now I can say I gave something back... ;-) –
Aquaplane
Might I suggest copying the full solution (the five lines of atoms and cookies and the replacing of the property) in your answer? It would help guarantee the availability of the full answer regardless of the availability of the mailing list archive you linked to. –
Kassie
© 2022 - 2024 — McMap. All rights reserved.