diff --git a/common/xutil.c b/common/xutil.c index d62af8eef..0cbecff5e 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -29,7 +29,6 @@ #include #include "common/xutil.h" -#include "common/atoms.h" #include "common/tokenize.h" /** Get the string value of an atom. diff --git a/common/xutil.h b/common/xutil.h index 6ecc0d311..b5e80f497 100644 --- a/common/xutil.h +++ b/common/xutil.h @@ -26,8 +26,23 @@ #include #include #include +#include -#include "array.h" +#include "common/array.h" +#include "common/atoms.h" + +static inline const char * +xutil_get_text_property_from_reply(xcb_get_property_reply_t *reply) +{ + if(reply + && (reply->type == STRING + || reply->type == UTF8_STRING + || reply->type == COMPOUND_TEXT) + && reply->format == 8 + && xcb_get_property_value_length(reply)) + return xcb_get_property_value(reply); + return NULL; +} bool xutil_text_prop_get(xcb_connection_t *, xcb_window_t, xcb_atom_t, char **, ssize_t *);