Path: utzoo!attcan!uunet!mcsun!ukc!acorn!john From: john@acorn.co.uk (John Bowler) Newsgroups: comp.windows.x Subject: Re: Bad pixmaps Message-ID: <2011@acorn.co.uk> Date: 20 Mar 90 18:12:14 GMT References: Reply-To: john@acorn.UUCP (John Bowler) Organization: Acorn Computers Ltd, Cambridge, UK Lines: 28 In article jcc@MAGILLA.SIEMENS.COM (Joe Camaratta) writes: > > Our application allocates and uses pixmaps, but looses its connection >to the server because of invalid Pixmap values. The number of pixmaps >that we can allocate seems to be dependent on the server on which the >application is running. Is there anyway of knowing when the Pixmap >value returned by the server is valid? > The server doesn't make up the numbers for the pixmaps - the application does. I encountered a similar problem in the X Test Suite (I left the volume/stress tester running over christmas last year...) In this case the resource_id field in the display structure was simply overflowing the number of bits granted to the application by the server - this number can vary from server to server (it must be at least 18, so you need to allocate at least 2^18 ids to overflow it...). You can find out if this is the problem by examining the resource id which the server doesn't like and comparing it with the information in the Xlib Display structure; in particular the resource_mask field. If it is the problem the fix is very application specific. The resource_alloc field of the Display structure needs to be changed to point to a routine which will allocate valid XID's. That doesn't just mean fixing the overflow, it also means avoiding allocating XIDs which are already in use. Not easy. In the X Test Suite I just modified the resource_id field directly so that the same XID was continuously reused (the pixmap was created then deleted immediately afterwards). John Bowler (jbowler@acorn.co.uk)