patches/pulseaudio-04-xcb.diff
author jurikm
Sun, 12 Feb 2012 14:04:10 +0000
changeset 8245 383896da4129
parent 3608 1c7d683a0b5d
permissions -rw-r--r--
SFEsauerbraten.spec: add IPS package name

--- pulseaudio-0.9.22/configure.ac-orig	2011-07-14 03:12:54.768084315 -0500
+++ pulseaudio-0.9.22/configure.ac	2011-07-14 03:13:23.147606522 -0500
@@ -516,7 +516,7 @@ AC_ARG_ENABLE([x11],
         [x11=auto])
 
 if test "x${x11}" != xno ; then
-    PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
+    PKG_CHECK_MODULES(X11, [ x11-xcb xcb >= 1.6 ice sm xtst ],
         HAVE_X11=1,
         [
             HAVE_X11=0
--- pulseaudio-0.9.22/src/pulsecore/x11prop.c-orig	2011-07-14 02:58:51.526660985 -0500
+++ pulseaudio-0.9.22/src/pulsecore/x11prop.c	2011-07-14 03:10:45.123567613 -0500
@@ -30,7 +30,6 @@
 #include <pulsecore/macro.h>
 
 #include <xcb/xproto.h>
-#include <xcb/xcb_atom.h>
 
 #define PA_XCB_FORMAT 8
 
@@ -50,28 +49,43 @@ static xcb_screen_t *screen_of_display(x
 
 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_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);
+        reply = xcb_intern_atom_reply(xcb,
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
+                                      NULL);
+
+        if (reply) {
+            xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom,
+                                XCB_ATOM_STRING, PA_XCB_FORMAT,
+                                (int) strlen(data), (const void*) data);
+
+            free(reply);
+        }
     }
 }
 
 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_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);
+        reply = xcb_intern_atom_reply(xcb,
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
+                                      NULL);
+
+        if (reply) {
+            xcb_delete_property(xcb, xs->root, reply->atom);
+            free(reply);
+        }
     }
 }
 
@@ -81,7 +95,7 @@ char* pa_x11_get_prop(xcb_connection_t *
     xcb_get_property_cookie_t req;
     xcb_get_property_reply_t* prop = NULL;
     xcb_screen_t *xs;
-    xcb_atom_t a;
+    xcb_intern_atom_reply_t *reply;
 
     pa_assert(xcb);
     pa_assert(name);
@@ -99,9 +113,15 @@ char* pa_x11_get_prop(xcb_connection_t *
         xs = screen_of_display(xcb, 0);
 
     if (xs) {
-        a = xcb_atom_get(xcb, name);
+        reply = xcb_intern_atom_reply(xcb,
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
+                                      NULL);
+
+        if (!reply)
+            goto finish;
 
-        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));
+        free(reply);
         prop = xcb_get_property_reply(xcb, req, NULL);
 
         if (!prop)