[comp.windows.x] HP, transparency, XAllocNamedColor

gdykes@batcomputer.tn.cornell.edu (Gene Dykes) (03/05/90)

This may be an HP server specific problem, but the problem crops up in
XAllocNamedColor(), so it could be something more general.  Nobody on
comp.sys.hp could help me out:

The problem is in getting transparent windows when running in the overlay
planes of a 9000/835 server.  I added the entry for transparent to the
rgb.txt file and remade the rgb.dir,pag files, so the problem does not
lie there.  This is confirmed by the fact that there is no problem when
I run the server on a machine which uses the turboSRX graphics box.  When
the same server is run on an SRX graphics box, however, I can not get
the transparent windows specified in my resource files.  This used to work
fine with HP's R3 server.

I did some testing, and it turns out that XAllocNamedColor(..."transparent"...)
returns a transparent pixel (0 0 1) on the turboSRX, but fails on the SRX.
However, if I use XAllocColor, specifying (0 0 1), it works.

The key seems to lie in that DefaultDepth is 3 on an SRX and 4 on a turboSRX.
For some reason, the server, when running on an SRX decides it can't allocate
a pixel with colors (0 0 1) when called by XAllocNamedColor(), but on a
TurboSRX it decides it can.  It seems clear to me that it could and should
be able to accomplish this on either one.  What goes on in XAllocNamedColor
that the depth affects whether or not it can translate "transparent" into
(0 0 1) ?  Don't forget: XAllocColor works.

Thanks for any help.  I really can't convert my users to R4 until
they can see their data in the graphics planes!

-- 
Gene Dykes, gdykes@tcgould.tn.cornell.edu