[Xcb] [PATCH 2/2] julia: update for xcb-util >= 0.3.8

William Swanson swansontec at gmail.com
Sat Nov 17 03:13:37 PST 2012


---
 tests/julia.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/julia.c b/tests/julia.c
index 75468ce..a6e8a5b 100644
--- a/tests/julia.c
+++ b/tests/julia.c
@@ -8,10 +8,10 @@
 #include <xcb/shm.h>
 #include <xcb/xcb_aux.h>
 #include <xcb/xcb_image.h>
-#include <xcb/xcb_atom.h>
+#include <xcb/xcb_event.h>
 #define XCB_ALL_PLANES ~0
 
-/* Needed for xcb_set_wm_protocols() */
+/* Needed for xcb_icccm_set_wm_protocols() */
 #include <xcb/xcb_icccm.h>
 
 #include "julia.h"
@@ -186,13 +186,19 @@ main (int argc, char *argv[])
 
   palette_julia (&data);
 
-  xcb_atom_t deleteWindowAtom = xcb_atom_get(data.conn, "WM_DELETE_WINDOW");
-  xcb_atom_t wmprotocolsAtom = xcb_atom_get(data.conn, "WM_PROTOCOLS");
+  xcb_intern_atom_cookie_t wmprotocolsCookie, deleteWindowCookie;
+  wmprotocolsCookie = xcb_intern_atom(data.conn, 0, 12, "WM_PROTOCOLS");
+  deleteWindowCookie = xcb_intern_atom(data.conn, 0, 16, "WM_DELETE_WINDOW");
+
+  xcb_atom_t wmprotocolsAtom, deleteWindowAtom;
+  wmprotocolsAtom = xcb_intern_atom_reply(data.conn, wmprotocolsCookie, NULL)->atom;
+  deleteWindowAtom = xcb_intern_atom_reply(data.conn, 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 (data.conn, wmprotocolsAtom, data.draw, 1, &deleteWindowAtom);
+  xcb_icccm_set_wm_protocols (data.conn, data.draw, wmprotocolsAtom, 1, &deleteWindowAtom);
 
   xcb_flush (data.conn);
 
-- 
1.8.0



More information about the Xcb mailing list