#include <X11/Xlib.h>#include <X11/Xatom.h>#include <X11/Xmu/WinUtil.h>Include dependency graph for ClientWin.c:

Go to the source code of this file.
Functions | |
| static Window | TryChildren (Display *, Window, Atom) |
| Window | XmuClientWindow (Display *dpy, Window win) |
| static Window TryChildren | ( | Display * | , | |
| Window | , | |||
| Atom | ||||
| ) | [static] |
Definition at line 68 of file ClientWin.c.
References data, i, NULL, root, and type.
Referenced by XmuClientWindow().
00069 { 00070 Window root, parent; 00071 Window *children; 00072 unsigned int nchildren; 00073 unsigned int i; 00074 Atom type = None; 00075 int format; 00076 unsigned long nitems, after; 00077 unsigned char *data; 00078 Window inf = 0; 00079 00080 if (!XQueryTree(dpy, win, &root, &parent, &children, &nchildren)) 00081 return 0; 00082 for (i = 0; !inf && (i < nchildren); i++) { 00083 data = NULL; 00084 XGetWindowProperty(dpy, children[i], WM_STATE, 0, 0, False, 00085 AnyPropertyType, &type, &format, &nitems, 00086 &after, &data); 00087 if (data) 00088 XFree(data); 00089 if (type) 00090 inf = children[i]; 00091 } 00092 for (i = 0; !inf && (i < nchildren); i++) 00093 inf = TryChildren(dpy, children[i], WM_STATE); 00094 if (children) 00095 XFree(children); 00096 return inf; 00097 }
Here is the caller graph for this function:

| Window XmuClientWindow | ( | Display * | dpy, | |
| Window | win | |||
| ) |
Definition at line 43 of file ClientWin.c.
References data, NULL, TryChildren(), and type.
00044 { 00045 Atom WM_STATE; 00046 Atom type = None; 00047 int format; 00048 unsigned long nitems, after; 00049 unsigned char *data = NULL; 00050 Window inf; 00051 00052 WM_STATE = XInternAtom(dpy, "WM_STATE", True); 00053 if (!WM_STATE) 00054 return win; 00055 XGetWindowProperty(dpy, win, WM_STATE, 0, 0, False, AnyPropertyType, 00056 &type, &format, &nitems, &after, &data); 00057 if (data) 00058 XFree(data); 00059 if (type) 00060 return win; 00061 inf = TryChildren(dpy, win, WM_STATE); 00062 if (!inf) 00063 inf = win; 00064 return inf; 00065 }
Here is the call graph for this function:

1.5.1