From 7fd0771522240445bd7d4d1df1e6bce79119c483 Mon Sep 17 00:00:00 2001 From: Maciej Grela Date: Tue, 29 Mar 2011 22:56:28 +0159 Subject: x11: Fix build errors with newest xcb-util. The xcb_atom_get functions were removed from xcb-util. Changed these to xcb_intern_atom/xcb_intern_atom_reply. Also, STRING is now XCB_ATOM_STRING. --- src/pulsecore/x11prop.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/pulsecore/x11prop.c b/src/pulsecore/x11prop.c index 4cb21daa..d66c48f5 100644 --- a/src/pulsecore/x11prop.c +++ b/src/pulsecore/x11prop.c @@ -50,28 +50,34 @@ static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen) void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const char *data) { xcb_screen_t *xs; - xcb_atom_t a; + xcb_intern_atom_cookie_t cookie; + xcb_intern_atom_reply_t *reply; pa_assert(xcb); pa_assert(name); pa_assert(data); if ((xs = screen_of_display(xcb, screen))) { - a = xcb_atom_get(xcb, name); - xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data); + cookie = xcb_intern_atom(xcb, 0, strlen(name), name); + reply = xcb_intern_atom_reply(xcb, cookie, NULL); + + xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom, XCB_ATOM_STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data); } } void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) { xcb_screen_t *xs; - xcb_atom_t a; + xcb_intern_atom_cookie_t cookie; + xcb_intern_atom_reply_t *reply; pa_assert(xcb); pa_assert(name); if ((xs = screen_of_display(xcb, screen))) { - a = xcb_atom_get(xcb, name); - xcb_delete_property(xcb, xs->root, a); + cookie = xcb_intern_atom(xcb, 0, strlen(name), name); + reply = xcb_intern_atom_reply(xcb, cookie, NULL); + + xcb_delete_property(xcb, xs->root, reply->atom); } } @@ -81,7 +87,8 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char xcb_get_property_cookie_t req; xcb_get_property_reply_t* prop = NULL; xcb_screen_t *xs; - xcb_atom_t a; + xcb_intern_atom_cookie_t cookie; + xcb_intern_atom_reply_t *reply; pa_assert(xcb); pa_assert(name); @@ -99,9 +106,10 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char xs = screen_of_display(xcb, 0); if (xs) { - a = xcb_atom_get(xcb, name); + cookie = xcb_intern_atom(xcb, 0, strlen(name), name); + reply = xcb_intern_atom_reply(xcb, cookie, NULL); - req = xcb_get_property(xcb, 0, xs->root, a, STRING, 0, (uint32_t)(l-1)); + req = xcb_get_property(xcb, 0, xs->root, reply->atom, XCB_ATOM_STRING, 0, (uint32_t)(l-1)); prop = xcb_get_property_reply(xcb, req, NULL); if (!prop) -- cgit v1.2.3