summaryrefslogtreecommitdiff
path: root/x-window-list.c
blob: 84c2bd2cf1f1571dff767885be721c7b9fd7adbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <X11/Xlib.h>

// 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++) {