[Xcb] [PATCH 1/2] flames: update for xcb-util >= 0.3.8
William Swanson
swansontec at gmail.com
Sat Nov 17 03:13:36 PST 2012
---
tests/flames.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/tests/flames.c b/tests/flames.c
index 89e93cf..3cc0459 100644
--- a/tests/flames.c
+++ b/tests/flames.c
@@ -31,9 +31,9 @@
#include <xcb/shm.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_image.h>
-#include <xcb/xcb_atom.h>
+#include <xcb/xcb_event.h>
-/* Needed for xcb_set_wm_protocols() */
+/* Needed for xcb_icccm_set_wm_protocols() */
#include <xcb/xcb_icccm.h>
#define XCB_ALL_PLANES ~0
@@ -215,13 +215,19 @@ main ()
flame_set_flame_zero (f);
flame_set_random_flame_base (f);
- xcb_atom_t deleteWindowAtom = xcb_atom_get(f->xcb.c, "WM_DELETE_WINDOW");
- xcb_atom_t wmprotocolsAtom = xcb_atom_get(f->xcb.c, "WM_PROTOCOLS");
+ xcb_intern_atom_cookie_t wmprotocolsCookie, deleteWindowCookie;
+ wmprotocolsCookie = xcb_intern_atom(f->xcb.c, 0, 12, "WM_PROTOCOLS");
+ deleteWindowCookie = xcb_intern_atom(f->xcb.c, 0, 16, "WM_DELETE_WINDOW");
+
+ xcb_atom_t wmprotocolsAtom, deleteWindowAtom;
+ wmprotocolsAtom = xcb_intern_atom_reply(f->xcb.c, wmprotocolsCookie, NULL)->atom;
+ deleteWindowAtom = xcb_intern_atom_reply(f->xcb.c, deleteWindowCookie, NULL)->atom;
+
/* Listen to X client messages in order to be able to pickup
the "delete window" message that is generated for example
when someone clicks the top-right X button within the window
manager decoration (or when user hits ALT-F4). */
- xcb_set_wm_protocols (f->xcb.c, wmprotocolsAtom, f->xcb.draw, 1, &deleteWindowAtom);
+ xcb_icccm_set_wm_protocols (f->xcb.c, f->xcb.draw, wmprotocolsAtom, 1, &deleteWindowAtom);
bool finished = false;
while (!finished)
--
1.8.0
More information about the Xcb
mailing list