PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2 of the License,
+ by the Free Software Foundation; either version 2.1 of the License,
or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
}
/* IO notification event for the X11 display connection */
-static void display_io_event(pa_mainloop_api *m, pa_io_event *e, int fd, PA_GCC_UNUSED pa_io_event_flags_t f, void *userdata) {
+static void display_io_event(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {
pa_x11_wrapper *w = userdata;
pa_assert(m);
}
/* IO notification event for X11 internal connections */
-static void internal_io_event(pa_mainloop_api *m, pa_io_event *e, int fd, PA_GCC_UNUSED pa_io_event_flags_t f, void *userdata) {
+static void internal_io_event(pa_mainloop_api *m, pa_io_event *e, int fd, pa_io_event_flags_t f, void *userdata) {
pa_x11_wrapper *w = userdata;
pa_assert(m);
pa_core_assert_ref(c);
- pa_snprintf(t, sizeof(t), "x11-wrapper%s%s", name ? "-" : "", name ? name : "");
+ pa_snprintf(t, sizeof(t), "x11-wrapper%s%s", name ? "@" : "", name ? name : "");
+
if ((w = pa_shared_get(c, t)))
return pa_x11_wrapper_ref(w);
pa_assert(w);
pa_assert(PA_REFCNT_VALUE(w) >= 1);
- if (PA_REFCNT_DEC(w) <= 0)
- x11_wrapper_free(w);
+ if (PA_REFCNT_DEC(w) > 0)
+ return;
+
+ x11_wrapper_free(w);
}
Display *pa_x11_wrapper_get_display(pa_x11_wrapper *w) {
return w->display;
}
+xcb_connection_t *pa_x11_wrapper_get_xcb_connection(pa_x11_wrapper *w) {
+ return XGetXCBConnection(pa_x11_wrapper_get_display(w));
+}
+
void pa_x11_wrapper_kill(pa_x11_wrapper *w) {
pa_x11_client *c, *n;