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.
This commit is contained in:
Maciej Grela 2011-03-29 22:56:28 +01:59 committed by Colin Guthrie
parent 3bb6546548
commit 7fd0771522

View file

@ -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)