XGetImage problem...

Marcus Schäfer ms at suse.de
Fri Mar 24 11:31:45 PST 2006


Hi,

> On Friday 24 March 2006 11:46, Marcus Schäfer wrote:
> 
> > I added a call to XGetGeometry and printed the values which
> > are really really out of any range... very big negative integers
> > so XGetImage is surely right with its BadMatch exception
> >
> > I asume the data I got from the XGetWindowProperty() call is
> > far away from beeing a pixmap but it returend "Success"
> 
>  How is the property being set?
>  If it's raw pixmap data, you can't just cast it, you need to call a funtion 
> to create a pixmap from it - XCreateBitmapFromData().

The problem here was that the code did it that way. it uses the 
_XROOTPMAP_ID property and casts the data pointer into a Pixmap which
works if the parent of this client is a Window. Some windowmanagers have
their own "root" window. If the parent is the plain X root window
obained by calling DefaultRootWindow() this mechanism will fail.
Failing here means the data pointer of the XGetWindowProperty()
call is null

I thought it doesn't work because of the used property and added code
using the _XSETROOT_ID property. I saw the data pointer is not null
and tried to cast into a Pixmap. Well maybe I'm doing something
very stupid but it looks so easy to fix ;)

The type of the call has been set to XA_PIXMAP and I checked the type
which was correct. That's why I assume the data is a pixmap and I
could cast it in the same way as the original code does.

Please fix me if I'm doing something completely wrong

Thanks

Regards
Marcus
-- 
 Public Key available
 -------------------------------------------------------
 Marcus Schäfer (Res. & Dev.)   SUSE LINUX Products GmbH
 Tel: 0911-740 53 0             Maxfeldstrasse 5
 FAX: 0911-740 53 479           D-90409 Nürnberg
 http://www.suse.de             Germany
 -------------------------------------------------------



More information about the xorg mailing list