summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2009-05-09 18:03:28 +0200
committerJulien Danjou <julien@danjou.info>2009-05-09 18:03:28 +0200
commit85c7984f110dabb23ebaef367bcf6df96ad34377 (patch)
tree8a0baad5733eee78bb657e219cb2f9cd4e6bd1ef
parente6725408d518624ce73ec578a5fdd37eb90b4d8d (diff)
icccm: fix compatibility with libxcb > 1.2
The get property value proto changed so we do not have to worry about formats. Reflect that change. Signed-off-by: Julien Danjou <julien@danjou.info>
-rw-r--r--configure.ac2
-rw-r--r--icccm/icccm.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 86091f4..6e0d97c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,7 +47,7 @@ AC_SUBST(xcbincludedir)
pkgconfigdir='${libdir}/pkgconfig'
AC_SUBST(pkgconfigdir)
-PKG_CHECK_MODULES(XCB, xcb >= 1.0)
+PKG_CHECK_MODULES(XCB, xcb > 1.2)
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/icccm/icccm.c b/icccm/icccm.c
index d818d7e..1c3de0d 100644
--- a/icccm/icccm.c
+++ b/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;