On Mon, 2009-03-16 at 10:57 +0800, Ren, Zhaohan wrote: > Hi all > Windows and pixmaps together are known as drawables. Now I get a > "drawable" ID(Created by XCreateWindow or XCreatePixmap) , I want to > know how to distinguish them, that is to say how to distinguish if a > "drawable ID" is a pixmap ID or window ID. > It seems that I didn't find any Xlib interface to achieve this. Are > there any good method to use?
There's no good interface for this, or for discovering the type of an
arbitrary XID in general. If you think you need one you're probably
mistaken. Why do you think you need to do this?
You _can_ do something like:
static int pixmap = 0;
static int pixmap_check(Display *d, void *v) { pixmap = 1; return 0; }
/* ... */
XWindowAttributes xwa;
void *old_handler = XSetErrorHandler(dpy, pixmap_check);
XGetWindowAttributes(dpy, draw, &xwa);
XSetErrorHandler(dpy, old_handler);
if (pixmap) /* whatever */
But really, don't.
- ajax
signature.asc
Description: This is a digitally signed message part
_______________________________________________ xorg-devel mailing list [email protected] http://lists.x.org/mailman/listinfo/xorg-devel
