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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3608
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     1
--- pulseaudio-0.9.22/configure.ac-orig	2011-07-14 03:12:54.768084315 -0500
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     2
+++ pulseaudio-0.9.22/configure.ac	2011-07-14 03:13:23.147606522 -0500
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     3
@@ -516,7 +516,7 @@ AC_ARG_ENABLE([x11],
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     4
         [x11=auto])
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     5
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     6
 if test "x${x11}" != xno ; then
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     7
-    PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     8
+    PKG_CHECK_MODULES(X11, [ x11-xcb xcb >= 1.6 ice sm xtst ],
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
     9
         HAVE_X11=1,
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    10
         [
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    11
             HAVE_X11=0
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    12
--- pulseaudio-0.9.22/src/pulsecore/x11prop.c-orig	2011-07-14 02:58:51.526660985 -0500
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    13
+++ pulseaudio-0.9.22/src/pulsecore/x11prop.c	2011-07-14 03:10:45.123567613 -0500
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    14
@@ -30,7 +30,6 @@
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    15
 #include <pulsecore/macro.h>
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    16
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    17
 #include <xcb/xproto.h>
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    18
-#include <xcb/xcb_atom.h>
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    19
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    20
 #define PA_XCB_FORMAT 8
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    21
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    22
@@ -50,28 +49,43 @@ static xcb_screen_t *screen_of_display(x
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    23
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    24
 void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const char *data) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    25
     xcb_screen_t *xs;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    26
-    xcb_atom_t a;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    27
+    xcb_intern_atom_reply_t *reply;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    28
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    29
     pa_assert(xcb);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    30
     pa_assert(name);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    31
     pa_assert(data);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    32
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    33
     if ((xs = screen_of_display(xcb, screen))) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    34
-        a = xcb_atom_get(xcb, name);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    35
-        xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    36
+        reply = xcb_intern_atom_reply(xcb,
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    37
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    38
+                                      NULL);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    39
+
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    40
+        if (reply) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    41
+            xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom,
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    42
+                                XCB_ATOM_STRING, PA_XCB_FORMAT,
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    43
+                                (int) strlen(data), (const void*) data);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    44
+
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    45
+            free(reply);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    46
+        }
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    47
     }
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    48
 }
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    49
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    50
 void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    51
     xcb_screen_t *xs;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    52
-    xcb_atom_t a;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    53
+    xcb_intern_atom_reply_t *reply;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    54
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    55
     pa_assert(xcb);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    56
     pa_assert(name);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    57
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    58
     if ((xs = screen_of_display(xcb, screen))) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    59
-        a = xcb_atom_get(xcb, name);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    60
-        xcb_delete_property(xcb, xs->root, a);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    61
+        reply = xcb_intern_atom_reply(xcb,
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    62
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    63
+                                      NULL);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    64
+
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    65
+        if (reply) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    66
+            xcb_delete_property(xcb, xs->root, reply->atom);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    67
+            free(reply);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    68
+        }
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    69
     }
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    70
 }
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    71
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    72
@@ -81,7 +95,7 @@ char* pa_x11_get_prop(xcb_connection_t *
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    73
     xcb_get_property_cookie_t req;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    74
     xcb_get_property_reply_t* prop = NULL;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    75
     xcb_screen_t *xs;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    76
-    xcb_atom_t a;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    77
+    xcb_intern_atom_reply_t *reply;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    78
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    79
     pa_assert(xcb);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    80
     pa_assert(name);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    81
@@ -99,9 +113,15 @@ char* pa_x11_get_prop(xcb_connection_t *
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    82
         xs = screen_of_display(xcb, 0);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    83
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    84
     if (xs) {
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    85
-        a = xcb_atom_get(xcb, name);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    86
+        reply = xcb_intern_atom_reply(xcb,
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    87
+                                      xcb_intern_atom(xcb, 0, strlen(name), name),
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    88
+                                      NULL);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    89
+
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    90
+        if (!reply)
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    91
+            goto finish;
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    92
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    93
-        req = xcb_get_property(xcb, 0, xs->root, a, STRING, 0, (uint32_t)(l-1));
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    94
+        req = xcb_get_property(xcb, 0, xs->root, reply->atom, XCB_ATOM_STRING, 0, (uint32_t)(l-1));
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    95
+        free(reply);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    96
         prop = xcb_get_property_reply(xcb, req, NULL);
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    97
 
1c7d683a0b5d 2010-07-13 Brian Cameron <[email protected]>
yippi
parents:
diff changeset
    98
         if (!prop)