wmutils

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

commit eb2dd623389bb641bedde940135c6467b8671cbc
parent d6ab5516915e86fbdadfaa03993f62f47142cbd1
Author: z3bra <willy@mailoo.org>
Date:   Wed Dec 17 12:08:53 2014

added function get_windows() ot util.c

Diffstat:
 util.c | 14 ++++++++++++++
 util.h |  1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/util.c b/util.c @@ -79,3 +79,17 @@ ignore(xcb_connection_t *con, xcb_window_t w) free(r); return or; } + +void +get_windows(xcb_connection_t *con, xcb_window_t w, xcb_window_t **l) +{ + xcb_query_tree_cookie_t c; + xcb_query_tree_reply_t *r; + + c = xcb_query_tree(con, w); + r = xcb_query_tree_reply(con, c, NULL); + if (r == NULL) + errx(1, "0x%08x: no such window", w); + + *l = xcb_query_tree_children(r); +} diff --git a/util.h b/util.h @@ -5,6 +5,7 @@ void init_xcb(xcb_connection_t **); void kill_xcb(xcb_connection_t **); void get_screen(xcb_connection_t *, xcb_screen_t **); +void get_windows(xcb_connection_t *, xcb_window_t, xcb_window_t **); int exists(xcb_connection_t *, xcb_window_t); int mapped(xcb_connection_t *, xcb_window_t);