From xemacs-m  Mon Mar 10 19:24:55 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id TAA04360
	for <xemacs-beta@xemacs.org>; Mon, 10 Mar 1997 19:24:49 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQcgin07662; Mon, 10 Mar 1997 20:24:50 -0500 (EST)
Date: Mon, 10 Mar 1997 20:24:50 -0500 (EST)
Message-Id: <QQcgin07662.199703110124@crystal.WonderWorks.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Kyle Jones <kyle_jones@wonderworks.com>
To: xemacs-beta@xemacs.org
Subject: [PATCH] 19.15b98: possible fix for toolbar shadow lossage
In-Reply-To: <8495.858033630@rtp.ericsson.se>
References: <199703101351.OAA15982@sonne.darmstadt.gmd.de>
	<QQcghk01503.199703101806@crystal.WonderWorks.COM>
	<8495.858033630@rtp.ericsson.se>
X-Face: /cA45WHG7jWq>(O3&Z57Y<"WsX5ddc,4c#w0F*zrV#=M
        0@~@,s;b,aMtR5Sqs"+nU.z^CSFQ9t`z2>W,S,]:[+2^
        Nbf6v4g>!&,7R4Ot4Wg{&tm=WX7P["9%a)_da48-^tGy
        ,qz]Z,Zz\{E.,]'EO+F)@$KtF&V

I think I'm beginning to understand what's going on.  The pixel
values seem to be different depending on your display type.  I
have a 24-bit deep display at home and the pixel values there
are the direct color values.  I assumed this was the way they
were set everywhere.  On an 8-bit display, the values seem to
always be small integers, which suggests to me (someone who
knows as much about X programming as a cockroach knows about
bug spray) that they are indexes into an array of color cells.
Like say, a colormap.

So.  If I'm right, my patch will not work at all on 8-bit
displays.  I don't feel so badly about it; the old code had no
chance of working on any display, because it was checking an
unsigned variable for a negative value.

It seems the best fix for this is to make the code just check
whether the shadow colors are the same value, and if so, ignore
them.

Here is the patch.  THOSE WHO HAVE SEEN THE TOOLBAR SHADOW LOSSAGE
PLEASE TRY THIS.  I'd like to avoid another beta cycle with this
being broken, if possible.  It is a simple patch, and eilminates
the problem for me.

*** /tmp/T0a001Ks	Mon Mar 10 20:20:40 1997
--- src/toolbar-x.c	Mon Mar 10 20:13:57 1997
***************
*** 673,685 ****
    FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) =
      XtGetGC ((Widget) ef, flags, &gcv);
  
!   if (ef->emacs_frame.top_toolbar_shadow_pixel == 0)
      {
        ef->emacs_frame.top_toolbar_shadow_pixel =
  	ef->emacs_frame.background_toolbar_pixel;
-     }
-   if (ef->emacs_frame.bottom_toolbar_shadow_pixel == 0)
-     {
        ef->emacs_frame.bottom_toolbar_shadow_pixel =
  	ef->emacs_frame.background_toolbar_pixel;
      }
--- 673,683 ----
    FRAME_X_TOOLBAR_BLANK_BACKGROUND_GC (f) =
      XtGetGC ((Widget) ef, flags, &gcv);
  
!   if (ef->emacs_frame.top_toolbar_shadow_pixel ==
!       ef->emacs_frame.bottom_toolbar_shadow_pixel)
      {
        ef->emacs_frame.top_toolbar_shadow_pixel =
  	ef->emacs_frame.background_toolbar_pixel;
        ef->emacs_frame.bottom_toolbar_shadow_pixel =
  	ef->emacs_frame.background_toolbar_pixel;
      }



