Peter Harris pharris at
Wed Apr 8 08:11:15 PDT 2009

Patrick O'Donnell wrote:
>> From: Peter Harris <pharris at>
>> ...Even if you do need to work on a PseudoColor display, you're far
>> better off allocating a new Colormap[1] and calling XStoreColors once
>> (to fill the whole Colormap with exactly the colors you need) for
>> this sort of thing.
> But for nearly all systems, allocating a new colormap for specific
> windows creates color flashing when the windows change focus.

Historically, yes. These days, I believe the scorecard reads:

Linux: Default install is TrueColor only.
Solaris: Default install is TrueColor only (?).
AIX: Root visual is TrueColor, PseudoColor is available (no flashing
unless some other app is already using the PseudoColor visual -- unlikely).
IRIX: dead. But when it was alive, it often had multiple hardware
colormaps (little or no flashing) even when the root visual was PseudoColor.
MacOSX: Default install is TrueColor only.
Windows: XP and newer needs gymnastics to use anything but TrueColor. X
servers running on Windows mostly provide PseudoColor via emulation
(infinite installed colormaps, no flashing).

Embedded systems get to write their own rules, of course.

>  When
> there are enough color slots avilable in the default colormap,
> XAllocColors (note the plural) gives a much more pleasing effect.

Indeed. Working with the default colormap is preferable when you only
need a few colors.

> (Though, I just really noticed the the "million".  That could indeed
> change the balance.)

Yes, JPEG is, by definition, a TrueColor source image. Which is why I
suggested allocating a new colormap (or, I guess, you could use a
TrueColor visual for just the splash screen if one is available). You
pretty much always want more than a few colors. So on the root colormap
you're going to hit XAllocColor(Cells) allocation limits very quickly
(ugly image), and you're going to suck up all the remaining color cells
and leave none for any other application (impolite and/or DoS, depending
on the resiliency of those other apps).

Peter Harris
               Open Text Connectivity Solutions Group
Peter Harris          
Research and Development        Phone: +1 905 762 6001
pharris at            Toll Free: 1 877 359 4866

More information about the xorg mailing list