Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!LIGHTNING.MCRCIM.MCGILL.EDU!mouse From: mouse@LIGHTNING.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: XAllocColor bug Message-ID: <9012010719.AA00347@lightning.McRCIM.McGill.EDU> Date: 1 Dec 90 07:19:00 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 24 > The following program demonstrates a bug when trying to allocate a > color cell. This is in the X11R4 server. > * If: > * A color cell is allocated using XAllocColorCells > * The allocated color cell is configured using XStoreColor > * Then: > * An attempt to use the same color cell via XAllocColor will fail in one of two ways: > * If additional color cell is available: (The case in the program below) > * A new one will be allocated. > * Else: > * XAllocColor will fail (return 0) > * Both of these are bugs; in both cases, the previously allocated cell should be returned This is not a bug; this is how it's supposed to work. XAllocColorCells allocates read/write cells; XAllocColor is defined to never return a read/write cell. If you allocate the initial cell with XAllocColor, so as to get a read-only cell, then a second XAllocColor should, and undoubtedly will, return the same cell. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu