[EMAIL PROTECTED] wrote:

The man page says that XGetWindowAttributes will work for a pixmap as well as for a window, although only some components of the result will be meaningful for a pixmap.

When I call XGetWindowAttributes specifying a pixmap for the drawable, I get a BadWindow error

Any ideas what I am doing wrong?

I'd say you're mis-reading the man page (or you could be looking at a bugging
man page).

When I look at the man page for XGetWindowAttributes() it shows the syntax
of XGetGeometry() as well.  The former takes a window as the 2nd parameter;
the latter takes a drawable as the 2nd parameter.

A drawable is either a window or a pixmap.  So XGetGeometry will work for
a pixmap in addition to a window (x_return and y_return always being zero in
the case of a pixmap), but XGetWindowAttributes only works on windows.

Thanks. You're right. Now that I carefully re-read the man page on Linux, XGetWindowAttributes operates only on a Window.

I had been using an old O'Reilly book (Xlib Reference Manual, copyright 1990) which really does say that you can use XGetWindowAttributes on a pixmap. Now that I'm using XGetGeometry, everything works fine.

Dan



_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to