summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Grela <maciej.grela@gmail.com>2011-03-29 22:56:28 +0159
committerColin Guthrie <colin@mageia.org>2011-05-07 17:01:17 +0100
commit7fd0771522240445bd7d4d1df1e6bce79119c483 (patch)
treef17e0af650f4042ad5e71322826849770e032102
parent3bb654654855abd9b0b527fb431b59f3b6bbfaf7 (diff)
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.
-rw-r--r--src/pulsecore/x11prop.c26
1 files 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)