diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2012-09-09 20:52:58 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2012-09-09 20:52:58 +0000 |
commit | 108136152493cb583435feeb532360c6ffcdd37f (patch) | |
tree | ae1de4e384d9daad5a3f89d976aeb7a1826f1840 | |
parent | a514e69ee8bb6f7915d6bd8437b003bae29c1d85 (diff) |
replace with xu_getprop wrapper used everywhere else.
-rw-r--r-- | app/cwm/group.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/app/cwm/group.c b/app/cwm/group.c index 85af7a1f9..f644851a4 100644 --- a/app/cwm/group.c +++ b/app/cwm/group.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: group.c,v 1.59 2012/07/08 01:00:24 okan Exp $ + * $OpenBSD: group.c,v 1.60 2012/09/09 20:52:57 okan Exp $ */ #include <sys/param.h> @@ -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++; } |