Path: utzoo!attcan!uunet!van-bc!mdavcr!furr From: furr@mdavcr.UUCP (Steven Furr) Newsgroups: comp.windows.x Subject: Re: XAllocColor bug Summary: not a bug Message-ID: <1084@mdavcr.UUCP> Date: 1 Dec 90 01:24:32 GMT References: <1990Nov30.204721.21570@Solbourne.COM> Organization: MacDonald Dettwiler, 13800 Commerce Parkway, Richmond, BC, Canada V6V 2J3 Lines: 30 garya writes: > /* > * 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 > */ If you refer to the manual you will find that XAllocColorCells allows you to allocate read/write cells. The client allocating these cells is free to change the pixel value with XStoreColors. For this reason, the server considers these cells to be non-shareable and will NOT return one of them to any client using an XAllocColor call. If it did, it is quite possible that the client owning the cell might change the value later and any clients using it would have incorrect colours displayed. It is possible for another client to make use of the pixel value for the cell (assuming it knows where it is or can find it -- with XQueryColors for example), but the server is not going to provide any assistance since it is considered a violation of conventions.