wmutils

X windows manipulation utilities
git clone git://z3bra.org/wmutils
Log | Files | Refs | LICENSE

commit c420551c1091fb6edda67493ea22925050a792ea
parent bdb3b35e838bf051857237a5bd4e0241a0c5bc52
Author: dcat <dcat@iotek.org>
Date:   Thu Dec 18 14:57:37 2014

blame it on the dcat

Diffstat:
 util.c |  9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/util.c b/util.c @@ -1,5 +1,6 @@ #include <err.h> #include <stdlib.h> +#include <string.h> #include <xcb/xcb.h> #include "util.h" @@ -83,7 +84,7 @@ ignore(xcb_connection_t *con, xcb_window_t w) int get_windows(xcb_connection_t *con, xcb_window_t w, xcb_window_t **l) { - int childnum = 0; + uint32_t childnum = 0; xcb_query_tree_cookie_t c; xcb_query_tree_reply_t *r; @@ -92,10 +93,12 @@ get_windows(xcb_connection_t *con, xcb_window_t w, xcb_window_t **l) if (r == NULL) errx(1, "0x%08x: no such window", w); - *l = xcb_query_tree_children(r); + *l = malloc(sizeof(xcb_window_t) * r->children_len); + memcpy(*l, xcb_query_tree_children(r), + sizeof(xcb_window_t) * r->children_len); childnum = r->children_len; - free(r); + free(r); return childnum; }