Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!bionet!apple!bloom-beacon!EXPO.LCS.MIT.EDU!keith From: keith@EXPO.LCS.MIT.EDU (Keith Packard) Newsgroups: comp.windows.x Subject: Re: Colormap problems with R3 Message-ID: <8811081928.AA05258@EXPO.LCS.MIT.EDU> Date: 8 Nov 88 19:28:36 GMT References: <835@nic.MR.NET> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 39 > Hello, I'm having some problems with changing the colormap in my program. > Here is what I'm doing: > > XCreateColormap() > XAllocColorCells() > XStoreColors() > XSetWindowColormap() > XInstallColormap() > XPutImage() The window manager is responsible for managing shared resources in the server (like screen real-estate, colormaps and the keyboard). To support this, some support was put into uwm to manage colormaps. It's pretty primitive as the ICCCM isn't ready yet. All that it does is notice colormap change events on top-level windows and track the keyboard focus, installing the colormap for the current window. If you simply remove the XInstallColormap call from your application, uwm will automatically notice the colormap change for the window and act accordingly. Problems arise when the colormap you created is not associated with the top-level window. Simply make the top-level window *also* use the new colormap and uwm will play ball. The ICCCM will address this issue directly, and propose mechanisms for managing different colormaps for sub-windows. Unfortunately, no other window managers track colormaps, so you might want to add code which optionally installs the new colormap (bleah). Eventually, you should expect all window managers to conform to the ICCCM proposal, in which case you would never call XInstallColormap in an application. Keith Packard MIT X Consortium (617) 253-1428 keith@EXPO.LCS.MIT.EDU