*** xc.orig/lib/Xaw3d/Imakefile	Sun Jul 29 21:04:28 2001
--- xc/lib/Xaw3d/Imakefile	Sun Jul 29 21:04:52 2001
***************
*** 39,48 ****
  
         LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
  
! #  EXTRA_DEFINES = -DARROW_SCROLLBAR -DUSEGRAY
!    EXTRA_DEFINES += -DUSEGRAY
  
! #  EXTRA_INCLUDES = -I.
  
  HEADERS = \
  	AllWidgets.h \
--- 39,48 ----
  
         LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
  
! EXTRA_DEFINES = -DARROW_SCROLLBAR -DUSEGRAY
  
! 
! EXTRA_INCLUDES = -I.
  
  HEADERS = \
  	AllWidgets.h \
*** xc.orig/lib/Xaw3d/Scrollbar.c	Sun Jul 29 21:04:29 2001
--- xc/lib/Xaw3d/Scrollbar.c	Mon Jul 30 01:08:29 2001
***************
*** 128,133 ****
--- 128,135 ----
         Offset(scrollbar.thumb), XtRImmediate, (XtPointer) XtUnspecifiedPixmap},
    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
         Offset(scrollbar.foreground), XtRString, XtDefaultForeground},
+   {XtNtroughColor, XtCTroughColor, XtRString, sizeof (char *),
+        Offset(scrollbar.trough_color_string), XtRString, "DefaultTroughColor"},
    {XtNshown, XtCShown, XtRFloat, sizeof(float),
         Offset(scrollbar.shown), XtRFloat, (XtPointer)&floatZero},
    {XtNtopOfThumb, XtCTopOfThumb, XtRFloat, sizeof(float),
***************
*** 240,245 ****
--- 242,265 ----
  #define MARGIN(sbw) (sbw)->threeD.shadow_width
  #endif
  
+ static void FillBArea (sbw)
+     ScrollbarWidget sbw;
+ {
+     int sw ;
+     int lx, ly, lw, lh;
+     if (XtIsRealized ((Widget) sbw)) {
+ 	if ((sw = sbw->threeD.shadow_width) < 0) 
+ 	    sw = 0;
+ 	ly = sw;
+ 	lx = sw;
+ 	lw = sbw->core.width - 2 * sw;
+ 	lh = sbw->core.height - 2 * sw;
+ 	XFillRectangle(XtDisplay((Widget) sbw), XtWindow((Widget) sbw), 
+ 		       sbw->scrollbar.gc_t, 
+ 		       lx, ly, (unsigned int) lw, (unsigned int) lh);
+     }    
+ }
+ 
  /* 
   The original Xaw Scrollbar's FillArea *really* relied on the fact that the 
   server was going to clip at the window boundaries; so the logic was really
***************
*** 281,289 ****
--- 301,314 ----
  			sbw->scrollbar.gc, 
  			lx, ly, (unsigned int) lw, (unsigned int) lh);
      } else {
+ 	/*
  	XClearArea (XtDisplay((Widget) sbw), XtWindow((Widget) sbw), 
  			lx, ly, (unsigned int) lw, (unsigned int) lh, 
  			FALSE);
+ 	*/
+ 	XFillRectangle(XtDisplay((Widget) sbw), XtWindow((Widget) sbw), 
+ 		       sbw->scrollbar.gc_t, 
+ 		       lx, ly, (unsigned int) lw, (unsigned int) lh);
      }
  }
  
***************
*** 356,361 ****
--- 381,393 ----
          pt[3].x = xbr;  pt[3].y = ytl;
          pt[5].x = xtl;  pt[5].y = ybr;
  
+         if ((region == NULL) ||
+             (XRectInRegion (region, xtl, ytl, xbr, ybr) != RectangleOut)) {
+ 	    XClearArea (dpy, win, 
+ 			xtl,ytl,xbr-xtl,ybr-ytl,
+ 			FALSE);
+         }
+ 
          /* top-left shadow */
          if ((region == NULL) ||
              (XRectInRegion (region, xms, yms, xps, ytl) != RectangleOut) ||
***************
*** 514,521 ****
--- 546,559 ----
  		    pt[n].y = swap;
  		}
  	    }
+ 
+ 	    XFillPolygon (dpy, win, sbw->scrollbar.gc_s,
+ 			  pt + 4, 3, Complex, CoordModeOrigin);
  	    XFillPolygon (dpy, win, top, pt, 4, Complex, CoordModeOrigin);
  	    XFillPolygon (dpy, win, bot, pt + 4, 6, Complex, CoordModeOrigin);
+ 
+ 	    XFillPolygon (dpy, win, sbw->scrollbar.gc_s,
+ 			  pt + 10, 3, Complex, CoordModeOrigin);
  	    XFillPolygon (dpy, win, top, pt + 10, 6, Complex, CoordModeOrigin);
  	    XFillPolygon (dpy, win, bot, pt + 16, 4, Complex, CoordModeOrigin);
  
***************
*** 565,570 ****
--- 603,610 ----
  	XtRemoveTimeOut (sbw->scrollbar.timer_id);
  #endif
      XtReleaseGC (w, sbw->scrollbar.gc);
+     XtReleaseGC (w, sbw->scrollbar.gc_t);
+     XtReleaseGC (w, sbw->scrollbar.gc_s);
  }
  
  /*	Function Name: CreateGC
***************
*** 580,585 ****
--- 620,630 ----
      XGCValues gcValues;
      XtGCMask mask;
      unsigned int depth = 1;
+     XColor t_c,n_c ;
+     XColor get_c ;
+     Status status ;
+     Screen *scn = XtScreenOfObject(w) ;
+     Colormap cmap = DefaultColormapOfScreen(scn) ;
  
      if (sbw->scrollbar.thumb == XtUnspecifiedPixmap) {
          sbw->scrollbar.thumb = XmuCreateStippledPixmap (XtScreen(w), 
***************
*** 614,619 ****
--- 659,696 ----
      /* the creation should be non-caching, because */
      /* we now set and clear clip masks on the gc returned */
      sbw->scrollbar.gc = XtGetGC (w, mask, &gcValues);
+     sbw->scrollbar.gc_t = XtGetGC (w, 0, &gcValues);
+     if( strcmp("DefaultTroughColor",sbw->scrollbar.trough_color_string)==0 ){
+ 	get_c.pixel = sbw->core.background_pixel ;
+ 	XQueryColor(XtDisplay((Widget) sbw),cmap,&get_c) ;
+ 	t_c.red =  ((int)(0.85*get_c.red))>>8 ;
+ 	t_c.red |= t_c.red<<8 ;
+ 	t_c.green =  ((int)(0.85*get_c.green))>>8 ;
+ 	t_c.green |= t_c.green<<8 ;
+ 	t_c.blue =  ((int)(0.85*get_c.blue))>>8 ;
+ 	t_c.blue |= t_c.blue<<8 ;
+ 	status=XAllocColor(XtDisplay((Widget) sbw),cmap,&t_c) ;
+ 	if( status ){
+ 	    XSetForeground(XtDisplay((Widget) sbw), sbw->scrollbar.gc_t,
+ 			   t_c.pixel) ;
+ 	}
+     }
+     else {
+ 	status=XAllocNamedColor( XtDisplay((Widget) sbw), cmap, 
+ 			  sbw->scrollbar.trough_color_string,
+ 			  &n_c, &t_c ) ;
+ 	if( status ){
+ 	    XSetForeground(XtDisplay((Widget) sbw), sbw->scrollbar.gc_t,
+ 			   n_c.pixel) ;
+ 	}
+     }
+     if( status == 0 ){
+ 	XSetForeground(XtDisplay((Widget) sbw), sbw->scrollbar.gc_t,
+ 		       sbw->core.background_pixel) ;
+     }
+     sbw->scrollbar.gc_s = XtGetGC (w, 0, &gcValues);
+     XSetForeground(XtDisplay((Widget) sbw), sbw->scrollbar.gc_s,
+ 		   sbw->core.background_pixel) ;
  }
  
  static void SetDimensions (sbw)
***************
*** 757,768 ****
--- 834,850 ----
  	width = sbw->core.width - 2;
  	height = sbw->scrollbar.shownLength;
      }
+     /*
      if (region == NULL ||
  	XRectInRegion (region, x, y, width, height) != RectangleOut) {
+     */
  	/* Forces entire thumb to be painted. */
  	sbw->scrollbar.topLoc = -(sbw->scrollbar.length + 1);
+ 	FillBArea(sbw);
  	PaintThumb (sbw, event); 
+     /*
      }
+     */
  #ifdef ARROW_SCROLLBAR
      /* we'd like to be region aware here!!!! */
      PaintArrows (sbw);
*** xc.orig/lib/Xaw3d/Scrollbar.h	Tue Oct 15 23:41:21 1996
--- xc/lib/Xaw3d/Scrollbar.h	Mon Jul 30 01:07:12 2001
***************
*** 77,82 ****
--- 77,83 ----
   depth		     Depth		int		parent's depth
   destroyCallback     Callback		XtCallbackList	NULL
   foreground	     Foreground		Pixel		XtDefaultForeground
+  troughColor	     TroughColor	String		"DefaultTroughColor"
   height		     Height		Dimension	length or thickness
   insensitiveBorder   Insensitive	Pixmap		GreyPixmap
   jumpProc	     Callback		XtCallbackList	NULL
***************
*** 111,116 ****
--- 112,119 ----
  /* 
   * Most things we need are in StringDefs.h 
   */
+ #define XtCTroughColor "TroughColor"
+ #define XtNtroughColor "troughColor"
  
  #define XtCMinimumThumb "MinimumThumb"
  #define XtCShown "Shown"
*** xc.orig/lib/Xaw3d/ScrollbarP.h	Tue Oct 15 23:41:21 1996
--- xc/lib/Xaw3d/ScrollbarP.h	Mon Jul 30 01:07:29 2001
***************
*** 64,69 ****
--- 64,70 ----
  typedef struct {
       /* public */
      Pixel	  foreground;	/* thumb foreground color */
+     char	 *trough_color_string;
      XtOrientation orientation;	/* horizontal or vertical */
      XtCallbackList scrollProc;	/* proportional scroll */
      XtCallbackList thumbProc;	/* jump (to position) scroll */
***************
*** 94,99 ****
--- 95,102 ----
      char          direction;	/* a scroll has started; which direction */
  #endif
      GC		  gc;		/* a (shared) gc */
+     GC		  gc_t;
+     GC		  gc_s;
      Position	  topLoc;	/* Pixel that corresponds to top */
      Dimension	  shownLength;	/* Num pixels corresponding to shown */
      Boolean       pick_top;     /* pick thumb at top or anywhere*/
