From 940b2ed7498beeffc59d072e8d46f4018d72e443 Mon Sep 17 00:00:00 2001 From: Patrick Haller Date: Wed, 9 Mar 2011 13:01:01 +0800 Subject: initial x-window-list dev --- x-window-list.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 x-window-list.c (limited to 'x-window-list.c') diff --git a/x-window-list.c b/x-window-list.c new file mode 100644 index 0000000..84c2bd2 --- /dev/null +++ b/x-window-list.c @@ -0,0 +1,17 @@ +#include + +// http://tronche.com/gui/x/xlib/ +int main(void) { + Display *dpy; + Window w; + Window *root_return; + Window *parent_return; + Window **children_return; + unsigned int *nchildren_return; + + if(!(dpy = XOpenDisplay(NULL))) + return 1; + XQueryTree(display, DefaultRootWindow(dpy), root_return, parent_return, children_return, nchildren_return); + + for (int i=0; i < nchildren_return; i++) { + -- cgit v1.2.3