[comp.windows.x] Awm patch set #2

jkh@ardent.UUCP (Jordan Hubbard) (06/18/88)

Following is the second patch set to awm. For those who are wondering,
I intend to increment the revision level on sources when they are changed
in such a way as to fix a severe compilation problem, a pathological bug
or to upgrade the functionality of awm significanty. Less serious "nits"
will be bundled with more serious fixes before the revision level is
changed.

I also forgot to include the header of the first patch when I sent
it out. If you're keeping a record of these patches, please prepend this to it.

---- cut ----
/*
 * CHANGES:
 *
 * Modification of various includes for vax compatibility.
 *
 * UPDATED:
 *
 * FocusChng.c now rev 1.2
 * awm.c now rev 1.2
 * exp_path.c now rev 1.2
 *
 */

---- cut ----


And here is the second patch set.. Special thanks to Chris Thewalt,
Gene Spafford and Richard Draves.


---- Patch 02 ----
/*
 * CHANGES:
 *
 * Incorrect GC for icon clip mask fixed.
 * Incorrect use of icon.hPad and icon.vPad in numerous places (including
 * the man page) fixed.
 * Initial gadget placement corrected, GadgetBorder taken into account,
 * default gadget colors now correct.
 * system.awmrc file now renamed properly to def.awmrc everywhere.
 * Incorrect casts in gram.y fixed.
 * Bad & operator in Neaten.c fixed.
 * Man page cleaned up, undocumented boolean "title.push" now documented.
 * Imakefile & Makefile updated to pass CC and CFLAGS to menu package, making
 * it only necessary to change them in once place now.
 *
 * UPDATED:
 *
 * Icons.c.c now rev 1.2
 * Gadget.c now rev 1.2
 * gram.y now rev 1.2
 * Neaten.c now rev 1.2
 *
 */

*** awm.dst/Gadget.c	Thu Jun 16 12:11:51 1988
--- awm/Gadget.c	Fri Jun 17 18:50:32 1988
***************
*** 1,7 ****
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_Gadget_c = "$Header: Gadget.c,v 1.1 88/06/15 15:26:00 jkh Exp $";
  #endif  lint
  
  #include "X11/copyright.h"
--- 1,7 ----
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_Gadget_c = "$Header: Gadget.c,v 1.2 88/06/17 15:26:00 jkh Exp $";
  #endif  lint
  
  #include "X11/copyright.h"
***************
*** 30,35 ****
--- 30,38 ----
   *
   * 001 -- Jortan Hubbard, Ardent Computer.
   * Gadget boxes in title bars.
+  * 1.2 -- Jordan Hubbard, Ardent Computer.
+  *  GadgetBorders used in placement calculations, initial
+  *  gadget positions calculated correcly. (Chris Thewalt fixes).
   *
   */
  
***************
*** 142,161 ****
  	       ny = 0;
  	  if (dir == LeftGadgetGravity) {
  	       nx = lx + gdec->offset;
! 	       if (nx != 0 && nx == lx) /* not first time through, add pad */
  		    nx = lx + GadgetPad;
  	       if (nx < 0)
  		    nx = 0;
! 	       lx = nx + gdec->wide;
                 dir = RightGadgetGravity;
  	  }
  	  else if (dir == RightGadgetGravity) {	
  	       nx = rx - gdec->wide - gdec->offset;
! 	       if (!gdec->offset && rx != xwa.width)
! 		    nx -= GadgetPad;
! 	       if (nx > xwa.width)
! 		    nx = xwa.width - gdec->wide - 1;
! 	       rx = nx;
                 dir = LeftGadgetGravity;
  	  }
  	  else /* Center Gravity */
--- 145,162 ----
  	       ny = 0;
  	  if (dir == LeftGadgetGravity) {
  	       nx = lx + gdec->offset;
! 	       if (lx == 0) /* not first time through, add pad */
  		    nx = lx + GadgetPad;
  	       if (nx < 0)
  		    nx = 0;
! 	       lx = nx + gdec->wide + GadgetBorder;
                 dir = RightGadgetGravity;
  	  }
  	  else if (dir == RightGadgetGravity) {	
  	       nx = rx - gdec->wide - gdec->offset;
! 	       if (rx == xwa.width)
! 		    nx -= (2 * GadgetBorder + GadgetPad);
! 	       rx = nx - GadgetBorder;
                 dir = LeftGadgetGravity;
  	  }
  	  else /* Center Gravity */
***************
*** 339,351 ****
  			 }
  			 char_info = real_font->per_char[index];
  		    }
! 		    x = 0 - char_info.lbearing;
  		    y = char_info.ascent;
  	       }
  	       else {
  		    y = (gdec->high + (gdec->fontInfo->max_bounds.ascent -
  				       gdec->fontInfo->max_bounds.descent)) / 2;
! 		    x = 0;
  	       }
  	       XDrawString(dpy, awi->gadgets[i], awi->winGC, x,
  			   y, gdec->name, strlen(gdec->name));
--- 340,352 ----
  			 }
  			 char_info = real_font->per_char[index];
  		    }
! 		    x = GadgetBorder - char_info.lbearing;
  		    y = char_info.ascent;
  	       }
  	       else {
  		    y = (gdec->high + (gdec->fontInfo->max_bounds.ascent -
  				       gdec->fontInfo->max_bounds.descent)) / 2;
! 		    x = GadgetBorder;
  	       }
  	       XDrawString(dpy, awi->gadgets[i], awi->winGC, x,
  			   y, gdec->name, strlen(gdec->name));
*** awm.dst/Icons.c	Thu Jun 16 12:11:48 1988
--- awm/Icons.c	Fri Jun 17 18:49:10 1988
***************
*** 1,7 ****
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_Iconify_c = "$Header: Iconify.c,v 1.1 88/06/15 15:24:56 jkh Exp $";
  #endif  lint
  
  #include "X11/copyright.h"
--- 1,7 ----
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_Iconify_c = "$Header: Iconify.c,v 1.2 88/06/17 17:24:56 jkh Exp $";
  #endif  lint
  
  #include "X11/copyright.h"
***************
*** 56,61 ****
--- 56,64 ----
   * 000 -- L. Guarino Reid, DEC Ultrix Engineering Group
   * 001 -- Jordan Hubbard, Ardent Computer
   *  Many modifications for titled windows.
+  * 1.2 -- Jordan Hubbard, Ardent Computer.
+  * vPad and hPad usage corrected (Chris Thewalt fix).
+  * Clipping now set on right GC. 
   */
   
  #include "awm.h"
***************
*** 90,102 ****
       }
       tile = XCreatePixmap( dpy, RootWindow(dpy, scr), width, height,
  			  DefaultDepth(dpy, scr) );
-      if (clipmask)
- 	  XSetClipMask(dpy, IconGC, clipmask);
       gcv.foreground = ITextForeground;
       gcv.background = ITextBackground;
       iGC = XCreateGC(dpy, RootWindow(dpy, scr), (GCForeground | GCBackground),
  		     &gcv);
!      XCopyPlane( dpy, bitmap, tile, iGC, 0, 0, width, height, 0, 0, 1 );
       XFreeGC(dpy, iGC);
       if (width_return)
  	  *width_return = width;
--- 93,105 ----
       }
       tile = XCreatePixmap( dpy, RootWindow(dpy, scr), width, height,
  			  DefaultDepth(dpy, scr) );
       gcv.foreground = ITextForeground;
       gcv.background = ITextBackground;
       iGC = XCreateGC(dpy, RootWindow(dpy, scr), (GCForeground | GCBackground),
  		     &gcv);
!      if (clipmask)
! 	  XSetClipMask(dpy, iGC, clipmask);
!      XCopyPlane(dpy, bitmap, tile, iGC, 0, 0, width, height, 0, 0, 1 );
       XFreeGC(dpy, iGC);
       if (width_return)
  	  *width_return = width;
***************
*** 265,272 ****
        * Fix up sizes by padding.
        */
       if (!wmhints || !(wmhints->flags & (IconPixmapHint|IconWindowHint))) {
! 	  icon_w += (HIconPad << 1);
! 	  icon_h += (VIconPad << 1);
       }
  
       /*
--- 268,275 ----
        * Fix up sizes by padding.
        */
       if (!wmhints || !(wmhints->flags & (IconPixmapHint|IconWindowHint))) {
! 	  icon_w += (HIconPad);
! 	  icon_h += (VIconPad);
       }
  
       /*
*** awm.dst/Imakefile	Thu Jun 16 12:11:48 1988
--- awm/Imakefile	Fri Jun 17 20:34:08 1988
***************
*** 10,21 ****
  # Use these macros if you want the RTL Neaten package.
  # Also make sure that NEATEN_LIB points to the right place. See the README
  # file for instructions (though you can just define this and give it a shot).
! #       DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)system.awmrc\" -DNEATEN
  #       LOCAL_LIBRARIES = $(NEATEN_ARCH) $(MENU_ARCH) $(XLIB)
  
  
  # Use these macros if you don't want the RTL Neaten package.
!         DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)system.awmrc\"
          LOCAL_LIBRARIES = $(MENU_ARCH) $(XLIB)
  
  # Define this if you're compiling XReadBitmapFileData with awm, rather
--- 10,21 ----
  # Use these macros if you want the RTL Neaten package.
  # Also make sure that NEATEN_LIB points to the right place. See the README
  # file for instructions (though you can just define this and give it a shot).
! #       DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)def.awmrc\" -DNEATEN
  #       LOCAL_LIBRARIES = $(NEATEN_ARCH) $(MENU_ARCH) $(XLIB)
  
  
  # Use these macros if you don't want the RTL Neaten package.
!         DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)def.awmrc\"
          LOCAL_LIBRARIES = $(MENU_ARCH) $(XLIB)
  
  # Define this if you're compiling XReadBitmapFileData with awm, rather
***************
*** 48,54 ****
  
  $(MENU_ARCH)::
  	@echo Making menu package...
! 	@(cd $(MENU_LIB); make)
  	@echo done.
  
  $(NEATEN_ARCH)::
--- 48,54 ----
  
  $(MENU_ARCH)::
  	@echo Making menu package...
! 	@(cd $(MENU_LIB); make CC=$(CC) CFLAGS="$CFLAGS")
  	@echo done.
  
  $(NEATEN_ARCH)::
*** awm.dst/Makefile	Thu Jun 16 12:11:50 1988
--- awm/Makefile	Fri Jun 17 20:39:10 1988
***************
*** 106,124 ****
  # Use these macros if you want the RTL Neaten package.
  # Also make sure that NEATEN_LIB points to the right place. See the README
  # file for instructions (though you can just define this and give it a shot).
! #       DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)system.awmrc\" -DNEATEN
  #       LOCAL_LIBRARIES = $(NEATEN_ARCH) $(MENU_ARCH) $(XLIB)
  
  # Use these macros if you don't want the RTL Neaten package.
!         DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)system.awmrc\"
          LOCAL_LIBRARIES = $(MENU_ARCH) $(XLIB)
  
  # Define this if you're compiling XReadBitmapFileData with awm, rather
  # than with Xlib. No guarantees that this will work with all source trees.
  # To be totally sure, compile it with Xlib.
! XRDOBJ=XRdBitFD.o
  
! # Below is just for make noident, remove it if you've moved XRdBitFD.c
  # someplace else.
  XRDSRC=XRdBitFD.c
  
--- 106,124 ----
  # Use these macros if you want the RTL Neaten package.
  # Also make sure that NEATEN_LIB points to the right place. See the README
  # file for instructions (though you can just define this and give it a shot).
! #       DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)def.awmrc\" -DNEATEN
  #       LOCAL_LIBRARIES = $(NEATEN_ARCH) $(MENU_ARCH) $(XLIB)
  
  # Use these macros if you don't want the RTL Neaten package.
!         DEFINES = -DSYSFILE=\"$(AWMDIR)$(PATHSEP)def.awmrc\"
          LOCAL_LIBRARIES = $(MENU_ARCH) $(XLIB)
  
  # Define this if you're compiling XReadBitmapFileData with awm, rather
  # than with Xlib. No guarantees that this will work with all source trees.
  # To be totally sure, compile it with Xlib.
! #XRDOBJ=XRdBitFD.o
  
! # Below is just for "make noident", remove it if you've moved XRdBitFD.c
  # someplace else.
  XRDSRC=XRdBitFD.c
  
***************
*** 171,177 ****
  
  $(MENU_ARCH)::
  	@echo Making menu package...
! 	@(cd $(MENU_LIB); make)
  	@echo done.
  
  $(NEATEN_ARCH)::
--- 171,177 ----
  
  $(MENU_ARCH)::
  	@echo Making menu package...
! 	@(cd $(MENU_LIB); make CC=$(CC) CFLAGS="$CFLAGS")
  	@echo done.
  
  $(NEATEN_ARCH)::
*** awm.dst/README	Thu Jun 16 12:12:00 1988
--- awm/README	Fri Jun 17 20:38:40 1988
***************
*** 15,21 ****
  Installation should be fairly straightforward. If you're using imake,
  first modify $(TOPDIR)/util/imake.includes/Imake.tmpl to define a macro
  called AWMDIR (look at UWMDIR for an example) which should point to
! someplace where you want to stash the system.awmrc file. If you like,
  you can just make UWMDIR and AWMDIR point to the same place since uwm
  and awm's file names are different and won't conflict with eachother. If
  you're using make (and don't want to use imake), modify the definition
--- 15,21 ----
  Installation should be fairly straightforward. If you're using imake,
  first modify $(TOPDIR)/util/imake.includes/Imake.tmpl to define a macro
  called AWMDIR (look at UWMDIR for an example) which should point to
! someplace where you want to stash the def.awmrc file. If you like,
  you can just make UWMDIR and AWMDIR point to the same place since uwm
  and awm's file names are different and won't conflict with eachother. If
  you're using make (and don't want to use imake), modify the definition
*** awm.dst/Refresh.c	Thu Jun 16 12:11:49 1988
--- awm/Refresh.c	Thu Jun 16 13:25:01 1988
***************
*** 70,75 ****
--- 70,78 ----
  {
      Entry("Refresh")
  
+ #ifdef titan
+     XTitanReset(dpy);
+ #endif /* titan */
      Leave( Redraw(RootWindow(dpy,scr), mask, button, x, y) )
  }
  
*** awm.dst/awm.c	Fri Jun 17 18:24:03 1988
--- awm/awm.c	Fri Jun 17 18:30:55 1988
***************
*** 730,737 ****
       
       GadgetPad = GetIntRes("gadget.pad", DEF_GADGET_PAD);
       GadgetBorder = GetIntRes("gadget.border", DEF_GADGET_BORDER);
!      HIconPad = GetIntRes("icon.vPad", DEF_ICON_PAD);
!      VIconPad = GetIntRes("icon.hPad", DEF_ICON_PAD);
       RaiseDelay = GetIntRes("raiseDelay", DEF_RAISE_DELAY);
       MaxColors = GetIntRes("maxColors", DEF_MAX_COLORS);
       PBorderWidth = GetIntRes("popup.borderWidth", DEF_POP_BORDER_WIDTH);
--- 730,737 ----
       
       GadgetPad = GetIntRes("gadget.pad", DEF_GADGET_PAD);
       GadgetBorder = GetIntRes("gadget.border", DEF_GADGET_BORDER);
!      HIconPad = GetIntRes("icon.hPad", DEF_ICON_PAD);
!      VIconPad = GetIntRes("icon.vPad", DEF_ICON_PAD);
       RaiseDelay = GetIntRes("raiseDelay", DEF_RAISE_DELAY);
       MaxColors = GetIntRes("maxColors", DEF_MAX_COLORS);
       PBorderWidth = GetIntRes("popup.borderWidth", DEF_POP_BORDER_WIDTH);
***************
*** 1319,1324 ****
  XIOError(dsp)
  Display *dsp;
  {
!      perror("awm");
       exit(3);
  }
--- 1319,1324 ----
  XIOError(dsp)
  Display *dsp;
  {
!      /* perror("awm"); */
       exit(3);
  }
*** awm.dst/awm.man	Thu Jun 16 12:11:58 1988
--- awm/awm.man	Fri Jun 17 20:44:02 1988
***************
*** 49,55 ****
  override previous specifications.  Files in the \fIawm\fP
  search path are:
  .EX
! $LIBDIR\fI/awm/system.awmrc\fP
  $HOME\fI/.awmrc\fP
  .EE
  .PP
--- 49,55 ----
  override previous specifications.  Files in the \fIawm\fP
  search path are:
  .EX
! $LIBDIR\fI/awm/def.awmrc\fP
  $HOME\fI/.awmrc\fP
  .EE
  .PP
***************
*** 343,349 ****
  The border context refers to the artificial border area created when
  the resource \fBborderContext.width\fP is defined (see \fBborderContext.width\fP
  under \fBX DEFAULTS\fP). Using this context when no border area exists
! (i.e. \fborderContext.width\fP is not defined) is a noop.
  .PP
  A (null) context is indicated when the context field is left blank,
  and allows a function to be invoked from any screen location. This
--- 343,349 ----
  The border context refers to the artificial border area created when
  the resource \fBborderContext.width\fP is defined (see \fBborderContext.width\fP
  under \fBX DEFAULTS\fP). Using this context when no border area exists
! (i.e. \fBborderContext.width\fP is not defined) is a noop.
  .PP
  A (null) context is indicated when the context field is left blank,
  and allows a function to be invoked from any screen location. This
***************
*** 584,591 ****
  .IP "\fBgrid\fP (boolean) ``off''"
  Display a finely ruled grid when positioning or resizing
  windows/icons.
- .IP "\fBhIconPad\fP (int) ``2''"
- Number of pixels to pad icon text horizontally.
  .IP "\fBhilite\fP (boolean) ``off''"
  Causes the following actions to occur when a window gains the input
  focus:
--- 584,589 ----
***************
*** 624,629 ****
--- 622,631 ----
  Which font to use for icon text.
  .IP "\fBicon.foreground\fP (string) ``\fBforeground\fP''"
  Icon (pixmap) foreground color.
+ .IP "\fBicon.hPad\fP (int) ``2''"
+ Number of pixels to pad icon text horizontally.
+ .IP "\fBicon.vPad\fP (int) ``2''"
+ Number of pixels to pad icon text vertically.
  .IP "\fBicon.text.background\fP (string) ``\fBicon.background\fP''"
  Background color to use for icon text.
  .IP "\fBicon.text.foreground\fP (string) ``\fBicon.foreground\fP''"
***************
*** 795,800 ****
--- 797,810 ----
  The name of a pixmap file to load and tile titlebars with.
  This background is use exclusively unless the \fBtitle.boldPixmap\fP is
  defined and \fBhilite\fP is set.
+ .IP "\fBtitle.push\fP (boolean) ``true''"
+ When adding a title bar to a window, put the title bar at the windows
+ current x, y position and "push" the window down to make room. For windows
+ with an upper edge at or near the top of the screen, this gives the most
+ asthetically pleasing results. For windows near the bottom, it does not.
+ If set to false, the title bar will be added "on top" and the window will not
+ be moved down. Note that the setting of this resource also affects
+ how the window is maniplated during resizes, title removals, etc.
  .IP "\fBtitle.text.background\fP (string) ``\fBtitle.background\fP''"
  Background color to use when drawing title bar text.
  .IP "\fBtitle.text.foreground\fP (string) ``\fBtitle.foreground\fP''"
***************
*** 802,809 ****
  .IP "\fBtitles\fP (boolean) ``off''"
  Put title bars on all windows (both existing windows and new ones as
  they're created. See also: \fBf.title\fP
- .IP "\fBvIconPad\fP (int) ``2''"
- Number of pixels to pad icon text vertically.
  .IP "\fBvolume\fP (int) ``2''"
  Specifies the bell volume (delta on volume set with \fIxset\fP).
  .IP "\fBwall\fP (boolean) ``off''"
--- 812,817 ----
***************
*** 908,914 ****
  $LIBDIR/rgb.txt 
  $LIBDIR/font 
  /usr/skel/.awmrc
! $LIBDIR/awm/system.awmrc
  $HOME/.awmrc
  .fi
  .PP 
--- 916,922 ----
  $LIBDIR/rgb.txt 
  $LIBDIR/font 
  /usr/skel/.awmrc
! $LIBDIR/awm/def.awmrc
  $HOME/.awmrc
  .fi
  .PP 
*** awm.dst/def.awmrc	Thu Jun 16 12:11:48 1988
--- awm/def.awmrc	Fri Jun 17 20:37:31 1988
***************
*** 25,31 ****
  f.circledown=	m|s	::		left down
  f.menu=			:root:		middle down	: "WindowOps"
  f.menu=		m|s	::		middle down	: "WindowOps"
! f.menu=		m|s	::		middle down	: "Preferences"
  f.circleup=	m|s	::		right down
  f.iconify=	m|c	:window|icon:	left down
  f.newiconify=	m|l	:window|icon:	left down
--- 25,32 ----
  f.circledown=	m|s	::		left down
  f.menu=			:root:		middle down	: "WindowOps"
  f.menu=		m|s	::		middle down	: "WindowOps"
! f.menu=		m|s	:root:		left down	: "Preferences"
! f.menu=		m|s	::		left down	: "Preferences"
  f.circleup=	m|s	::		right down
  f.iconify=	m|c	:window|icon:	left down
  f.newiconify=	m|l	:window|icon:	left down
***************
*** 35,41 ****
--- 36,57 ----
  f.pushup=	m|l	:window|icon:	middle down
  f.pushdown=	m|c	:window|icon:	middle down
  
+ menu = "Preferences" {
+ Bell Loud:	!"xset b 7&"
+ Bell Normal:	!"xset b 3&"
+ Bell Off:	!"xset b off&"
+ Click Loud:	!"xset c 8&"
+ Click Soft:	!"xset c on&"
+ Click Off:	!"xset c off&"
+ Lock On:	!"xset l on&"
+ Lock Off:	!"xset l off&"
+ Mouse Fast:	!"xset m 4 2&"
+ Mouse Normal:	!"xset m 2 5&"
+ Mouse Slow:	!"xset m 1 1&"
+ }
+ 
  menu = "WindowOps" {
+ Preferences:	f.menu:	"Preferences"
  New Window:	!"xterm&"
  RefreshScreen:	f.refresh
  Redraw:		f.redraw
***************
*** 52,68 ****
  Freeze:		f.pause
  UnFreeze:	f.continue
  Restart:	f.restart
- }
- menu = "Preferences" {
- Bell Loud:	!"xset b 7&"
- Bell Normal:	!"xset b 3&"
- Bell Off:	!"xset b off&"
- Click Loud:	!"xset c 8&"
- Click Soft:	!"xset c on&"
- Click Off:	!"xset c off&"
- Lock On:	!"xset l on&"
- Lock Off:	!"xset l off&"
- Mouse Fast:	!"xset m 4 2&"
- Mouse Normal:	!"xset m 2 5&"
- Mouse Slow:	!"xset m 1 1&"
  }
--- 68,71 ----
*** awm.dst/gram.y	Thu Jun 16 12:11:51 1988
--- awm/gram.y	Fri Jun 17 18:50:50 1988
***************
*** 57,63 ****
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_gram_y = "$Header: gram.y,v 1.1 88/06/15 15:01:04 jkh Exp $";
  #endif	lint
  
  #include "X11/Xlib.h"
--- 57,63 ----
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_gram_y = "$Header: gram.y,v 1.2 88/06/17 15:01:04 jkh Exp $";
  #endif	lint
  
  #include "X11/Xlib.h"
***************
*** 930,942 ****
  	  yyerror(msg);
  	  Leave(NULL)
       }
!      tmp->data = 0;
!      tmp->name = (unsigned char *)0;
!      tmp->high = tmp->wide = tmp->offset = 0;
       tmp->gravity = g_gravity;
       tmp->offset = g_offset;
!      tmp->forecolor = g_forecolor ? g_forecolor : BlackPixel(dpy, scr);
!      tmp->backcolor = g_backcolor ? g_backcolor : WhitePixel(dpy, scr);
       tmp->fontInfo = g_font;
       g_font = (XFontStruct *)NULL;
       if (type != C_STRING && type != C_PIXMAP) {
--- 930,942 ----
  	  yyerror(msg);
  	  Leave(NULL)
       }
!      tmp->data = (unsigned char *)NULL;
!      tmp->name = (unsigned char *)NULL;
!      tmp->high = tmp->wide = 0;
       tmp->gravity = g_gravity;
       tmp->offset = g_offset;
!      tmp->forecolor = g_forecolor ? g_forecolor : ForeColor;
!      tmp->backcolor = g_backcolor ? g_backcolor : BackColor;
       tmp->fontInfo = g_font;
       g_font = (XFontStruct *)NULL;
       if (type != C_STRING && type != C_PIXMAP) {
***************
*** 954,960 ****
  	       sprintf(msg, "Can't find pixmap file '%s' for gadget #%d\n",
  		       nm, n);
  	       yywarn(msg);
! 	       tmp->data = (char *)gray_bits;
  	       tmp->high = gray_height;
  	       tmp->wide = gray_width;
  	  }
--- 954,960 ----
  	       sprintf(msg, "Can't find pixmap file '%s' for gadget #%d\n",
  		       nm, n);
  	       yywarn(msg);
! 	       tmp->data = (unsigned char *)gray_bits;
  	       tmp->high = gray_height;
  	       tmp->wide = gray_width;
  	  }
***************
*** 963,969 ****
  	      != BitmapSuccess) {
  	       sprintf(msg, "Can't open pixmap file '%s' for gadget #%d.\n", s, n);
  	       yyerror(msg);
! 	       tmp->data = (char *)gray_bits;
  	       tmp->high = gray_height;
  	       tmp->wide = gray_width;
  	  }
--- 963,969 ----
  	      != BitmapSuccess) {
  	       sprintf(msg, "Can't open pixmap file '%s' for gadget #%d.\n", s, n);
  	       yyerror(msg);
! 	       tmp->data = (unsigned char *)gray_bits;
  	       tmp->high = gray_height;
  	       tmp->wide = gray_width;
  	  }
***************
*** 998,1003 ****
--- 998,1004 ----
  	       tmp->wide = chinfo.width;
  	       tmp->high = chinfo.ascent + chinfo.descent;
  	  }
+ 	  tmp->wide += 2 * GadgetBorder;
            if (tmp->high > gadgetHeight)
  	       gadgetHeight = tmp->high;
       }
*** awm.dst/Neaten.c	Thu Jun 16 12:11:52 1988
--- awm/Neaten.c	Fri Jun 17 20:52:18 1988
***************
*** 1,7 ****
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_Neaten_c = "$Header: Neaten.c,v 1.1 88/06/15 15:26:00 jkh Exp $";
  #endif  lint
  
  #include "X11/copyright.h"
--- 1,7 ----
  #ident   "%W% %G%"
  
  #ifndef lint
! static char *rcsid_Neaten_c = "$Header: Neaten.c,v 1.2 88/06/17 15:26:00 jkh Exp $";
  #endif  lint
  
  #include "X11/copyright.h"
***************
*** 347,353 ****
  	       if (Neaten_Get_Geometry((int) w, &iconic, &tiled,
  				       &window_x, &window_y,
  				       &window_width, &window_height,
! 				       &(unsigned long) adjustment) == 0)
  		    continue;
  	       GetName(w, name);
  	       if(neaten_debug_level)
--- 347,353 ----
  	       if (Neaten_Get_Geometry((int) w, &iconic, &tiled,
  				       &window_x, &window_y,
  				       &window_width, &window_height,
! 				       (unsigned long) &adjustment) == 0)
  		    continue;
  	       GetName(w, name);
  	       if(neaten_debug_level)