[comp.windows.x] XFillRectangles X Protocol error in R3

blakec@pi3.local (Carl D. Blake) (08/28/90)

I have been using XFillRectangles to draw up to approximately 20,000
rectangles and have been getting the following X Protocol error:

X Protocol error:  BadLength poly request too large or internal Xlib length error
Major opcode of failed request: 70 (X_PolyFillRectangle)
Minor opcode of failed request: 0

I have discovered that I can still draw the rectangles if I lower the number
of rectangles I draw in one XFillRectangles call to something less than
8000 (9000 or greater lines causes the same error).

This problem has probably been hashed over before and is probably fixed
under R4, but I need to use R3.  Is just lowering the number of rectangles
to less than 8000 going to fix the problem for all time, or is it going
to seek up on me under different circumstances?  Also, do XDrawRectangles,
XDrawLines, and XDrawPoints suffer from the same malady?

Thanks for any help you can give me.

==============================================================================
Carl D. Blake                      | My opinions are my own.  I do not
blakec%tuva.sainet@ccc.nmfecc.gov  | represent SAIC in any way.
Science Applications International |
Tucson, AZ  85711-3796
602-748-7400
==============================================================================

klee@wsl.dec.com (Ken Lee) (08/29/90)

In article <9008272045.AA06156@pi3.local>, blakec@pi3.local (Carl D. Blake)
writes:
|> I have been using XFillRectangles to draw up to approximately 20,000
|> rectangles and have been getting the following X Protocol error:
|> 
|> X Protocol error:  BadLength poly request too large or internal Xlib length
error
|> Major opcode of failed request: 70 (X_PolyFillRectangle)
|> Minor opcode of failed request: 0

According to the X protocol, servers must accept protocol requests of
at least 16K bytes.  PolyFillRectangle is 8 bytes per rectangle plus 12
bytes of header, so you can send about 2000 rectangles with any
implementation.  Some implementations have higher limits.  Some Xlib
implementations, especially those based on the X11R4 sample Xlib, break
up the PolyFillRectangle requests to pieces within the 16K limit; with
these Xlib's, XFillRectangles calls can send many more rectangles
without worrying about the limit.

The same problem exists for other variable-length protocol requests.
Again, some Xlib's try to break up the long requests, but this is too
complicated for some requests, like FillPoly.

Ken Lee
DEC Western Software Laboratory, Palo Alto, Calif.
Internet: klee@wsl.dec.com
uucp: uunet!decwrl!klee