Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!kam From: kam@hpcvlx.HP.COM (Keith Marchington) Newsgroups: comp.sys.hp Subject: Re: X color maps and switching Message-ID: <101950043@hpcvlx.HP.COM> Date: 1 Aug 89 17:33:07 GMT References: <578@mmlai.UUCP> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 46 Yes Tony, we have noticed it and in reality, it is intentional. Here's the scenario: Starbase has a notion of a default setting of the colormap. I.e. when a program gopen's a "device" with either RESET or INIT specified in the mode field, the program can assume that the colormap is set up in a particular fashion. Many Starbase programs take advantage of this fact and do not bother to set up the colormap beyond that. X, on the other hand, assumes nothing about the initial state of the colormap. It allocates BlackPixel and WhitePixel in the default colormap, but beyond that the rest of the colormap is in an "unknown" state. Clients allocate pixels as need in what amounts to a random order. Now, how do we make these two systems work together. Well, X11 has the notion of virtual colormaps. I.e., a client can allocate a whole colormap and set it up in any fashion it desires. Then when any windows that have specified this colormap get the color focus (which usually follows input focus) the colormap is installed in the hardware. For displays that support only one colormap in hardware, this produces an interesting effect most refer to as "technicolor." So, since Starbase applications that are gopen'd with INIT | RESET assume that they have a particular colormap and full and unlimited use of that colormap to change as they see fit, we decided that when an X window is gopen'd with INIT | RESET, we would create a colormap for that window and initialize it in the Starbase fashion. In this way, old "window dumb" Starbase programs could continue to run and be visually correct without running rough-shod over the hardware colormap. And X applications needn't worry. The side effect, as you have seen is that when the Starbase window is visually correct, other windows are not. Please note though that this phenomenon is not restricted to Starbase applications. Other X applications are beginning to take advantage of virtual colormaps also and I expect to see this more frequently. Of course, in time we should see hardware capable of supporting colormaps on a per-window basis which will reduce the amount of "technicolor" that we must put up with. Ah, the price of flexibility! Keith