diff options
-rw-r--r-- | dist/xcb-util/atom/xcb_atom.h | 8 | ||||
-rw-r--r-- | dist/xcb-util/atom/xcb_atom.h.m4 | 8 | ||||
-rw-r--r-- | dist/xcb-util/aux/xcb_aux.c | 11 | ||||
-rw-r--r-- | dist/xcb-util/aux/xcb_aux.h | 6 | ||||
-rw-r--r-- | dist/xcb-util/configure.ac | 43 | ||||
-rw-r--r-- | dist/xcb-util/event/event.c | 1 | ||||
-rw-r--r-- | dist/xcb-util/icccm/icccm.c | 16 |
7 files changed, 81 insertions, 12 deletions
diff --git a/dist/xcb-util/atom/xcb_atom.h b/dist/xcb-util/atom/xcb_atom.h index d96e8fa1f..dfebe2472 100644 --- a/dist/xcb-util/atom/xcb_atom.h +++ b/dist/xcb-util/atom/xcb_atom.h @@ -3,6 +3,10 @@ #include <xcb/xcb.h> +#ifdef __cplusplus +extern "C" { +#endif + enum xcb_atom_fast_tag_t { TAG_COOKIE, TAG_VALUE @@ -105,4 +109,8 @@ extern const xcb_atom_t CAP_HEIGHT; extern const xcb_atom_t WM_CLASS; extern const xcb_atom_t WM_TRANSIENT_FOR; +#ifdef __cplusplus +} +#endif + #endif /* __XCB_ATOM_H__ */ diff --git a/dist/xcb-util/atom/xcb_atom.h.m4 b/dist/xcb-util/atom/xcb_atom.h.m4 index 7eb44cd0e..357921168 100644 --- a/dist/xcb-util/atom/xcb_atom.h.m4 +++ b/dist/xcb-util/atom/xcb_atom.h.m4 @@ -3,6 +3,10 @@ #include <xcb/xcb.h> +#ifdef __cplusplus +extern "C" { +#endif + enum xcb_atom_fast_tag_t { TAG_COOKIE, TAG_VALUE @@ -39,4 +43,8 @@ char *xcb_atom_name_unique(const char *base, uint32_t id); define(`DO', `extern const xcb_atom_t $1;')dnl include(atomlist.m4)`'dnl +#ifdef __cplusplus +} +#endif + #endif /* __XCB_ATOM_H__ */ diff --git a/dist/xcb-util/aux/xcb_aux.c b/dist/xcb-util/aux/xcb_aux.c index 1adc02ae9..c81039885 100644 --- a/dist/xcb-util/aux/xcb_aux.c +++ b/dist/xcb-util/aux/xcb_aux.c @@ -208,6 +208,17 @@ xcb_aux_create_window_checked (xcb_connection_t *c, } xcb_void_cookie_t +xcb_aux_change_window_attributes_checked (xcb_connection_t *c, + xcb_window_t window, + uint32_t mask, + const xcb_params_cw_t *params) +{ + uint32_t value_list[16]; + pack_list(mask, (const uint32_t *)params, value_list); + return xcb_change_window_attributes_checked( c, window, mask, value_list ); +} + +xcb_void_cookie_t xcb_aux_change_window_attributes (xcb_connection_t *c, xcb_window_t window, uint32_t mask, diff --git a/dist/xcb-util/aux/xcb_aux.h b/dist/xcb-util/aux/xcb_aux.h index 011736efe..d49d4383e 100644 --- a/dist/xcb-util/aux/xcb_aux.h +++ b/dist/xcb-util/aux/xcb_aux.h @@ -102,6 +102,12 @@ xcb_aux_change_window_attributes (xcb_connection_t *c, uint32_t mask, const xcb_params_cw_t *params); +xcb_void_cookie_t +xcb_aux_change_window_attributes_checked (xcb_connection_t *c, + xcb_window_t window, + uint32_t mask, + const xcb_params_cw_t *params); + typedef struct { int32_t x; int32_t y; diff --git a/dist/xcb-util/configure.ac b/dist/xcb-util/configure.ac index 84956e863..c7f8ad7d6 100644 --- a/dist/xcb-util/configure.ac +++ b/dist/xcb-util/configure.ac @@ -1,11 +1,27 @@ AC_PREREQ(2.57) -AC_INIT([xcb-util],0.3.4,[xcb@lists.freedesktop.org]) +AC_INIT([xcb-util],0.3.5,[xcb@lists.freedesktop.org]) AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AC_CHECK_PROGS(M4, m4, [no]) +AC_CHECK_PROGS(M4, [m4 gm4], [no]) +if test $M4 != "no" ; then + AC_MSG_CHECKING([if $M4 supports -I]) + if $M4 -I. /dev/null > /dev/null 2>&1 ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + # Try finding the gnu version + AC_CHECK_PROGS(GM4, gm4, [no]) + if test $GM4 = "no" ; then + AC_PATH_PROGS(GNUM4, m4, [no], [/usr/gnu/bin]) + M4="$GNUM4" + else + M4="$GM4" + fi + fi +fi if test $M4 = "no"; then - AC_MSG_ERROR([Can't find m4, please install it and try again]) + AC_MSG_ERROR([Can't find usable m4, please install it and try again]) fi AC_CHECK_PROGS(GPERF, gperf, [no]) if test $GPERF = "no"; then @@ -31,7 +47,26 @@ AC_SUBST(xcbincludedir) pkgconfigdir='${libdir}/pkgconfig' AC_SUBST(pkgconfigdir) -PKG_CHECK_MODULES(XCB, xcb >= 1.0) +PKG_CHECK_MODULES(XCB, xcb >= 1.2) + +###### +# Check version of xcb-proto that xcb was compiled against +###### +xcbproto_required=1.5 + +# Moved from AX_COMPARE_VERSION to maintain proper output +AC_PROG_AWK + +AC_MSG_CHECKING([whether libxcb was compiled against xcb-proto >= $xcbproto_required]) +xcbproto_version=`$PKG_CONFIG --variable=xcbproto_version xcb` +AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="yes", xcbproto_ok="no") +AC_MSG_RESULT([$xcbproto_ok]) + +if test $xcbproto_ok = no; then + AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs needs to be compiled against version $xcbproto_required or higher]) +fi + + PKG_CHECK_MODULES(XCB_SHM, xcb-shm) PKG_CHECK_MODULES(XCB_RENDER, xcb-render) PKG_CHECK_MODULES(XPROTO, xproto >= 7.0.8) diff --git a/dist/xcb-util/event/event.c b/dist/xcb-util/event/event.c index ce83d6e66..1332a33c6 100644 --- a/dist/xcb-util/event/event.c +++ b/dist/xcb-util/event/event.c @@ -35,6 +35,7 @@ void xcb_event_handlers_init(xcb_connection_t *c, xcb_event_handlers_t *evenths) { + memset(evenths, 0, sizeof(xcb_event_handlers_t)); evenths->c = c; } diff --git a/dist/xcb-util/icccm/icccm.c b/dist/xcb-util/icccm/icccm.c index d818d7e2a..1c3de0d87 100644 --- a/dist/xcb-util/icccm/icccm.c +++ b/dist/xcb-util/icccm/icccm.c @@ -64,7 +64,7 @@ xcb_get_text_property_reply(xcb_connection_t *c, prop->_reply = reply; prop->encoding = prop->_reply->type; prop->format = prop->_reply->format; - prop->name_len = xcb_get_property_value_length(prop->_reply) * prop->format >> 3; + prop->name_len = xcb_get_property_value_length(prop->_reply); prop->name = xcb_get_property_value(prop->_reply); return 1; @@ -434,7 +434,7 @@ xcb_get_wm_size_hints_from_reply(xcb_size_hints_t *hints, xcb_get_property_reply if(!reply) return 0; - int length = xcb_get_property_value_length(reply); + int length = xcb_get_property_value_length(reply) / (reply->format / 8); if (!(reply->type == WM_SIZE_HINTS && (reply->format == 8 || reply->format == 16 || @@ -627,16 +627,16 @@ xcb_get_wm_hints_from_reply(xcb_wm_hints_t *hints, return 0; int length = xcb_get_property_value_length(reply); + int num_elem = length / (reply->format / 8); - if ((reply->type != WM_HINTS) || - (length < (XCB_NUM_WM_HINTS_ELEMENTS - 1)) || - (reply->format != 32)) + if (reply->type != WM_HINTS + || reply->format != 32 + || num_elem < XCB_NUM_WM_HINTS_ELEMENTS - 1) return 0; - memcpy(hints, (xcb_size_hints_t *) xcb_get_property_value(reply), - length * reply->format >> 3); + memcpy(hints, (xcb_size_hints_t *) xcb_get_property_value(reply), length); - if(length < XCB_NUM_WM_HINTS_ELEMENTS) + if(num_elem < XCB_NUM_WM_HINTS_ELEMENTS) hints->window_group = XCB_NONE; return 1; |