replace with xu_getprop wrapper used everywhere else.

This commit is contained in:
okan 2012-09-09 20:52:57 +00:00
parent 86524e21dd
commit 3a45879d76

16
group.c
View File

@ -458,18 +458,12 @@ group_update_names(struct screen_ctx *sc)
{ {
char **strings, *p; char **strings, *p;
unsigned char *prop_ret; unsigned char *prop_ret;
Atom type_ret; int i = 0, j = 0, nstrings = 0, n = 0, setnames = 0;
int format_ret, i = 0, nstrings = 0, n = 0, setnames = 0;
unsigned long bytes_after, num_ret;
if (XGetWindowProperty(X_Dpy, sc->rootwin, if ((j = xu_getprop(sc->rootwin, ewmh[_NET_DESKTOP_NAMES].atom,
ewmh[_NET_DESKTOP_NAMES].atom, 0, 0xffffff, False, cwmh[UTF8_STRING].atom, 0xffffff, (u_char **)&prop_ret)) > 0) {
cwmh[UTF8_STRING].atom, &type_ret, &format_ret, prop_ret[j - 1] = '\0'; /* paranoia */
&num_ret, &bytes_after, &prop_ret) == Success && while (i < j) {
prop_ret != NULL && format_ret == 8) {
/* failure, just set defaults */
prop_ret[num_ret - 1] = '\0'; /* paranoia */
while (i < num_ret) {
if (prop_ret[i++] == '\0') if (prop_ret[i++] == '\0')
nstrings++; nstrings++;
} }