On Fri, Jul 19, 2002 at 08:32:55PM -0400, Dan Espen wrote:
> Olivier Chapuis <[EMAIL PROTECTED]> writes:
> > On Thu, Jul 18, 2002 at 11:07:51AM +0100, Tim Phipps wrote:
> > > >
> > > >
> > > >But, when I run my Xserver with depth
> > > >8 (and fvwm allocate these 216 colors) I *cannot* reproduce any
> > > >problems, I can run netscape, xv, gimp, any gtk/gnome apps, any
> > > >kde apps ..etc without any problems.
> > > >
> > > You may be being helped by your graphics card/Xserver. If your setup 
> > > allows other colormaps to be active without deactivating the root 
> > > colormap then it could be that netscape etc have allocated a private 
> > > colormap and you don't notice. Other people on less advanced hardware 
> > > will.
> > >
> > 
> > What it seems to happen is that, under depth 8, XFree (or at least the
> > 2 Xserver that I can run on my laptop) allocate a color table at
> > startup of 244 colors. So there are only 12 free colors in the
> > colormap. This seems very few, but it seems to me that this is a very
> > reasonable way to implement sharded colors: there is no reason for a
> > client to take all the colors for itself and the X server decides for
> > all the clients almost all the colors.
> 
> I don't think those 244 colors you see are allocated.
> Thats the default state of the colormap.
> If you attempted to use one of those colorcells,
> they would change as soon as another app allocated a color
> that happened to use that cell.
>
> Using the colormap program I sent you, if the cell is allocated,
> you'll see a slash thru it when you press "s".

Of course I used the program you send to me :o). If I start my Xserver
with just an xterm the "colormap" program says me that I've only 12
free colors. After that I made an other check to see the effect of the
"new" palette. I computed the number of free colors before and after
the "new" palette are allocated.  Again I get only 12 free colors
before any colors are allocated, the number of free colors after the
allocation of the palette depends on the palette.  With the 216
palette I still get 12 free colors as with the palette with 16 colors
I get only 4 free colors!

> > I think that I've no problems with netscape et al. probably because
> > either the XFree color table is good or the apps take in account
> > XAllocColor failure in the good way (also, fortunately, the 216 colors
> > table that fvwm gives to me is a subset of the XFree table).
> 
> I don't know what kind of apps you are running, but
> there needs to be a lot of free colors in the colormap,
> or our users are going to have problems.
> I guarantee it.

Why you do not trust me? I run my Xserver with depth 8 and I get no
problems with all the app I can run (including "netscape -no-install").

> Before colorlimiting was implemented, we had
> frequent reports of color allocation problems.
> We still do when a user starts Netscape without -install,
> although 8bit color is getting rarer.
>
> > I am curious about what the others X implementation do.
> 
> Most X servers pre-allocate black and white, (2 colors).
> (Solaris and XFree).
>

Not my XFree-4.2 Xserver (with the neomagic or vesa driver).

AHHHHHH, I manage to run my old XFree-3.3.6 Xserver. Yes, in this case
only 2 colors is pre-allocated (black and white) and I can see the
netscape problems, gimp-1.2 and gtk+ 2 automatically use a private
colormap, and I see others various problems. If I use the 64 colors
palette I cannot see a lot of problems, but I am agree that allocating
64 colors at fvwm startup is not a very good idea.

> > > >The old method reduce colors in the good way only for xpm.  Now I
> > > >think we need to reduce colors for png, tinting and gradient.
> > > >Moreover, the most important thing concerning colors with a
> > > >pseudo color visual is that color allocation MUST never fail. I
> > > >do not see an other method that this color table method.
> > > > 
> > > >
> > > Instead of allocating colors you can query the colormap and find a close 
> > > match to the one you want and just use it. I'm not sure if it's possible 
> > > to find out if  a color cell is allocated to another client or not so it 
> > > may be that picking color cells like this leaves you exposed to the 
> > > color of the cell changing. Maybe allocing the color of the cell (rather 
> > > than the original color) would fix the cell color.
> > >
> > 
> > Yes, I think that this should work. But I do not think that this solve
> > the pbs I see with color limitation.
> 
> I still say tinting and gradients aren't going to work.
>

Tinting works fine here with XFree-4.2. With XFree-3.3 and 64 colors
it may works or not this depends on the image and tint.  Of course
gradient are ugly in both case (but never fully black).
 
> I didn't try png, but it looked like you had png working.
>

I get problems with png as I get color allocation failure in the "old"
color table. The "old" color limit works fine with xpm and go into 2
steps one done by fvwm the other one done by libXpm: the original
color name is replaced by fvwm by a color name in the table which
gives the closest color. Then, libXpm load the xpm by allowing a color
closeness of 40000, so I think that if the allocation of the reduced
color name fail libXpm try others colors until color allocation
succeed. So I think that with ColorLimit x, libXpm does not allocate
more than x colors but these x colors may be different than the x
first colors of the table.

When I implement color reduction for png I do it in one step: libpng
gives me rgb colors and I take the closest colors in the table. But I
get XAllocColor failure with the KDE icons set if I not use something
like ColorLimit 9. I also get AllocColor failure with tinting and ewmh
icons which use the same simple color limitation than png. Also with
XFree-4.2 you can get fvwm AllocColor failure even if a few colors are
used. So with XFree-4.2 you get very good result if you can found a
big color table which is a subset of the pre-allocated color
table. Also it seems that color limitation should be applied
everywhere (even for title, menu and module simple colors or fg, bg,
hi, sh colorset), if we do not want to use the 12 free colors.

So it seems that XFree-4.x used a drastically different method than
the others X implementation.

I will try to found a 3rd method which works with all X server.

Olivier
 
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to