diff options
author | okan <okan> | 2012-09-09 20:52:57 +0000 |
---|---|---|
committer | okan <okan> | 2012-09-09 20:52:57 +0000 |
commit | 3a45879d76f1fb222417a83d312fba42ae2eadf6 (patch) | |
tree | cde1423167da28d0fff354ec210e9986bb0140c6 /group.c | |
parent | 86524e21dd53bad45f4586a7cc856062b67f8033 (diff) | |
download | cwm-3a45879d76f1fb222417a83d312fba42ae2eadf6.tar.gz cwm-3a45879d76f1fb222417a83d312fba42ae2eadf6.tar.xz cwm-3a45879d76f1fb222417a83d312fba42ae2eadf6.zip |
replace with xu_getprop wrapper used everywhere else.
Diffstat (limited to 'group.c')
-rw-r--r-- | group.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/group.c b/group.c index f28640c..3370643 100644 --- a/group.c +++ b/group.c @@ -458,18 +458,12 @@ group_update_names(struct screen_ctx *sc) { char **strings, *p; unsigned char *prop_ret; - Atom type_ret; - int format_ret, i = 0, nstrings = 0, n = 0, setnames = 0; - unsigned long bytes_after, num_ret; - - if (XGetWindowProperty(X_Dpy, sc->rootwin, - ewmh[_NET_DESKTOP_NAMES].atom, 0, 0xffffff, False, - cwmh[UTF8_STRING].atom, &type_ret, &format_ret, - &num_ret, &bytes_after, &prop_ret) == Success && - prop_ret != NULL && format_ret == 8) { - /* failure, just set defaults */ - prop_ret[num_ret - 1] = '\0'; /* paranoia */ - while (i < num_ret) { + int i = 0, j = 0, nstrings = 0, n = 0, setnames = 0; + + if ((j = xu_getprop(sc->rootwin, ewmh[_NET_DESKTOP_NAMES].atom, + cwmh[UTF8_STRING].atom, 0xffffff, (u_char **)&prop_ret)) > 0) { + prop_ret[j - 1] = '\0'; /* paranoia */ + while (i < j) { if (prop_ret[i++] == '\0') nstrings++; } |