Ethereal-users: Re: [Ethereal-users] Seemingly Blank Follow TCP Stream Window

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 20 Mar 2002 13:38:41 -0800
On Wed, Mar 20, 2002 at 08:17:03AM -0500, Andrew C. Feren wrote:
> I have seen this before and never fully debugged the problem.  It
> seems to be an X or GTK problem.  What I saw was that some other
> application (Netscape for me) was grabbing lots of colors and this
> prevented Ethereal from getting the colors that it was trying to
> allocate.

Bleah.

Looking at "realize_property()" in "gtktext.c" in the GTK+ 1.2.7 source,
it appears that it calls "gdk_colormap_alloc_color()" without checking
the return value - "gdk_colormap_alloc_color()" returns a Boolean to
indicate whether it succeeded in allocating the color or not:

	http://developer.gnome.org/doc/API/gdk/gdk-colormaps-and-colors.html#GDK-COLORMAP-ALLOC-COLOR

I don't know whether GTK+ 2.0 does a better job (the old text widget is
deprecated in 2.0, but I don't know if the new widget can fall back on
other colors if the allocation fails, or if GDK falls back on other
colors, or if color allocation is moved earlier so that the application
can find out much earlier that it's out of luck, or what.

> 3?) There may be a possible code fix, but I didn't see it in the short
> time I spent poking around.

Perhaps Ethereal could explicitly allocate the color before using it -
perhaps even doing so when it starts up, or when you select a new color.
At least that way it can tell you you're out of luck, and fall back on
some default color.