v12i056: tvtwm, Patch5, Part01/01

toml at Solbourne.COM toml at Solbourne.COM
Wed Apr 24 17:07:17 AEST 1991


Submitted-by: toml at Solbourne.COM
Posting-number: Volume 12, Issue 56
Archive-name: tvtwm/patch5
Patch-To: tvtwm: Volume 9, Issue 2-11, 20, 66
Patch-To: tvtwm: Volume 10, Issue 73

#! /bin/sh
# This is a shell archive, meaning:
# 1.  Remove everything above the #! /bin/sh line.
# 2.  Save the resulting test in a file
# 3.  Execute the file with /bin/sh (not csh) to create the files:
#
#patch.5
#
# Created by toml () on Tue Apr 23 08:33:22 MDT 1991
#
if test -f 'patch.5'
then
    echo shar: will not over-write existing file "patch.5"
else
echo extracting "patch.5"
sed 's/^X//' >patch.5 <<'SHAR_EOF'
Xtvtwm patch 5
X
XThis patch fixes the following problems:
X
X 1.  Removed XSynchronize call from twm.c
X 2.  The panner windows do not move during a move operation unless  
X     the move is opaque.
X 3.  StayUpMenus keyword allows menus to be displayed until the next 
X     ButtonPress event. (Gregg Jensen uucigj at swbatl.sbc.com)
X 4.  f.zoom commands now obey size hints.
X 5.  Added PannerOpaqueScroll keyword
X	(Eric A. Anderson <uunet!andrew.cmu.edu!ea08+>
X 6.  TWM Windows menu is now sorted based upon the state of the
X     SortIconManager variable. (Eric A. Anderson)
X 7.  MenuTitleFont and TitleFontPadding variables added
X	(uunet!cstr.ed.ac.uk!rjc)
X 8.  PannerBackgroundPixmap and VirtualDesktopBackgroundPixmap must now be
X     specified inside of the Pixmaps list. (uunet!cstr.ed.ac.uk!rjc)
X 8.  Resize outlines now go away if a resize is cancelled in other than
X     the +0+0 quadrant.
X 9.  Primitive include file support for .{tv}twmrc via:
X     include filename    (Gregory Bond <uunet!bby.oz.au!gnb)
X10.  Panner interaction under OpenWindows 2.0 is fixed (bkm at eng.sun.com)
X
X
Xdiff -c old/add_window.c new/add_window.c
X*** old/add_window.c	Thu Nov 15 20:13:07 1990
X--- new/add_window.c	Tue Apr 23 08:17:12 1991
X***************
X*** 1108,1113 ****
X--- 1108,1114 ----
X  	    pm = None;
X  	}
X      }
X+ 
X      if (pm) {
X  	valuemask = CWBackPixmap;
X  	attributes.background_pixmap = pm;
X***************
X*** 1116,1127 ****
X--- 1117,1133 ----
X  	attributes.background_pixel = tmp_win->title.fore;
X      }
X  
X+     valuemask |= CWBackingStore;
X+     attributes.backing_store= NotUseful;
X+ 
X      w = XCreateWindow (dpy, tmp_win->title_w, 0, Scr->FramePadding,
X  		       (unsigned int) Scr->TBInfo.width, (unsigned int) h,
X  		       (unsigned int) 0,
X  		       Scr->d_depth, (unsigned int) CopyFromParent,
X  		       Scr->d_visual, valuemask, &attributes);
X+ 
X      if (pm) XFreePixmap (dpy, pm);
X+ 
X      return w;
X  }
X  
X***************
X*** 1296,1317 ****
X      if (tmp_win->hilite_w)
X        XUnmapWindow(dpy, tmp_win->hilite_w);
X      return;
X- }
X- 
X- 
X- SetHighlightPixmap (filename)
X-     char *filename;
X- {
X-     Pixmap pm = GetBitmap (filename);
X- 
X-     if (pm) {
X- 	if (Scr->hilitePm) {
X- 	    XFreePixmap (dpy, Scr->hilitePm);
X- 	}
X- 	Scr->hilitePm = pm;
X- 	Scr->hilite_pm_width = JunkWidth;
X- 	Scr->hilite_pm_height = JunkHeight;
X-     }
X  }
X  
X  
X--- 1302,1307 ----
Xdiff -c old/events.c new/events.c
X*** old/events.c	Thu Nov 15 20:13:08 1990
X--- new/events.c	Tue Apr 23 08:17:12 1991
X***************
X*** 33,38 ****
X--- 33,56 ----
X   * twm event handling
X   *
X   * $Log:	events.c,v $
X+  * Revision 9.0  91/04/23  07:40:32  toml
X+  * Revision bump
X+  * 
X+  * Revision 8.5  90/12/31  09:50:23  toml
X+  * A better StayUpMenu fix
X+  * 
X+  * Revision 8.4  90/12/31  09:45:03  toml
X+  * Fixes a StayUpMenus crash
X+  * 
X+  * Revision 8.3  90/12/29  16:39:30  toml
X+  * RJC patches
X+  * 
X+  * Revision 8.2  90/12/29  11:24:16  toml
X+  * Added PannerOpaqueScroll
X+  * 
X+  * Revision 8.1  90/12/29  10:13:10  toml
X+  * StayUpMenus
X+  * 
X   * Revision 8.0  90/11/15  20:02:36  toml
X   * Revision bump
X   * 
X***************
X*** 108,114 ****
X--- 126,135 ----
X  ScreenInfo *FindScreenInfo();
X  int ButtonPressed = -1;
X  int Cancel = FALSE;
X+ int GlobalFirstTime = True;
X+ int GlobalMenuButton = False;
X  
X+ 
X  void HandleCreateNotify();
X  void HandleReparentNotify();
X  
X***************
X*** 1077,1083 ****
X  	    }
X  	    flush_expose (Event.xany.window);
X  	    return;
X! 	} else if (Tmp_win->titlebuttons) {
X  	    int i;
X  	    Window w = Event.xany.window;
X  	    register TBWindow *tbw;
X--- 1098,1159 ----
X  	    }
X  	    flush_expose (Event.xany.window);
X  	    return;
X! 
X! 	} else if (Event.xany.window == Tmp_win->hilite_w)
X! 	       {
X! 	       GC gc = None;
X! 	       XGCValues gcv;
X! 	       Window w= Event.xany.window;
X! 	       
X! 	       if (Scr->hiliteLeftPm) 
X! 		   {
X! 		   gcv.foreground = Tmp_win->title.fore;
X! 		   gcv.background = Tmp_win->title.back;
X! 		   gcv.graphics_exposures = False;
X! 		   gc = XCreateGC (dpy, w,
X! 				   (GCForeground|GCBackground
X! 				    |GCGraphicsExposures),
X! 				   &gcv);
X! 		   if (gc) 
X! 		       {
X! 		       XCopyPlane (dpy, Scr->hiliteLeftPm, w,
X! 				   gc, 
X! 				   0, 0, 
X! 				   Scr->hilite_left_pm_width, 
X! 				   Scr->hilite_left_pm_height,
X! 				   0, 0, 1);
X! 		       XFreeGC (dpy, gc);
X! 		       }
X! 		   }
X! 	       
X! 	       if (Scr->hiliteRightPm) 
X! 		   {
X! 		   if ( gc==None ) 
X! 		       {
X! 		       gcv.foreground = Tmp_win->title.fore;
X! 		       gcv.background = Tmp_win->title.back;
X! 		       gcv.graphics_exposures = False;
X! 		       gc = XCreateGC (dpy, w,
X! 				       (GCForeground|GCBackground
X! 					|GCGraphicsExposures),
X! 				       &gcv);
X! 		       }
X! 		   if (gc) 
X! 		       {
X! 		       XCopyPlane (dpy, Scr->hiliteRightPm,w,
X! 				   gc, 
X! 				   Tmp_win->rightx
X! 				       - Tmp_win->highlightx
X! 				       - Scr->hilite_right_pm_width, 0, 
X! 				   Scr->hilite_right_pm_width, 
X! 				   Scr->hilite_right_pm_height,
X! 				   0, 0, 1);
X! 		       XFreeGC (dpy, gc);
X! 		       }
X! 		   }
X! 	       flush_expose (Event.xany.window);
X! 	       }
X! 	else if (Tmp_win->titlebuttons) {
X  	    int i;
X  	    Window w = Event.xany.window;
X  	    register TBWindow *tbw;
X***************
X*** 1520,1525 ****
X--- 1596,1613 ----
X      int xl, xr, yt, yb, w, h;
X      unsigned mask;
X  
X+     if (Scr->StayUpMenus)
X+     {
X+         if (GlobalFirstTime == True && GlobalMenuButton == True )
X+         {
X+             ButtonPressed = -1;
X+             GlobalFirstTime = False;
X+             return;
X+         } /* end if  */
X+     
X+         GlobalFirstTime = True;
X+     } /* end if  */
X+ 
X      if (Event.xany.window == Scr->Panner)
X      {
X  	HandlePannerButtonRelease(&Event);
X***************
X*** 1527,1533 ****
X      }
X      if (DragWindow != None)
X      {
X! 	MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
X  
X  	XFindContext(dpy, DragWindow, TwmContext, (caddr_t *)&Tmp_win);
X  	if (DragWindow == Tmp_win->frame)
X--- 1615,1621 ----
X      }
X      if (DragWindow != None)
X      {
X! 	MoveOutline(None, 0, 0, 0, 0, 0, 0);
X  
X  	XFindContext(dpy, DragWindow, TwmContext, (caddr_t *)&Tmp_win);
X  	if (DragWindow == Tmp_win->frame)
X***************
X*** 1686,1691 ****
X--- 1774,1782 ----
X      int y = Event.xbutton.y_root;
X      Bool center;
X  
X+     if (Scr->StayUpMenus)
X+ 	GlobalMenuButton = True;
X+ 
X      if (!Scr->NoGrabServer)
X  	XGrabServer(dpy);
X      if (w) {
X***************
X*** 1719,1726 ****
X      Cursor cur;
X  
X      /* pop down the menu, if any */
X!     if (ActiveMenu != NULL)
X! 	PopDownMenu();
X  
X      if (InfoLines) {
X  	XUnmapWindow(dpy, Scr->InfoWindow);
X--- 1810,1830 ----
X      Cursor cur;
X  
X      /* pop down the menu, if any */
X!     /* if (ActiveMenu != NULL)
X! 	PopDownMenu(); */
X!     if (Scr->StayUpMenus)
X!     {
X!         if (GlobalFirstTime == False && GlobalMenuButton == True)
X!         {
X!             return;
X!         } /* end if  */
X!     } /* end if  */
X!     else
X!     {
X!         /* pop down the menu, if any */
X!         if (ActiveMenu != NULL)
X!         PopDownMenu();
X!     } /* end else  */
X  
X      if (InfoLines) {
X  	XUnmapWindow(dpy, Scr->InfoWindow);
X***************
X*** 1728,1733 ****
X--- 1832,1839 ----
X      }
X      XSync(dpy, 0);			/* XXX - remove? */
X  
X+     /* @@@@@@@@@@@ Put this so that bound keys will do things.
X+        EG, meta-button one will let you move the panner. */
X      if (Event.xany.window == Scr->Panner)
X      {
X  	HandlePannerButtonPress(&Event);
X***************
X*** 1750,1756 ****
X  	if (Scr->OpaqueMove && DragWindow != None) {
X  	    XMoveWindow (dpy, DragWindow, origDragX, origDragY);
X  	} else {
X! 	    MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
X  	}
X  	XUnmapWindow(dpy, Scr->SizeWindow);
X  	if (!Scr->OpaqueMove)
X--- 1856,1862 ----
X  	if (Scr->OpaqueMove && DragWindow != None) {
X  	    XMoveWindow (dpy, DragWindow, origDragX, origDragY);
X  	} else {
X! 	    MoveOutline(None, 0, 0, 0, 0, 0, 0);
X  	}
X  	XUnmapWindow(dpy, Scr->SizeWindow);
X  	if (!Scr->OpaqueMove)
X***************
X*** 1774,1781 ****
X  	ButtonPressed = Event.xbutton.button;
X  
X      if (ResizeWindow != None ||
X! 	DragWindow != None  ||
X! 	ActiveMenu != NULL)
X  	return;
X  
X      /* check the title bar buttons */
X--- 1880,1886 ----
X  	ButtonPressed = Event.xbutton.button;
X  
X      if (ResizeWindow != None ||
X! 	DragWindow != None)
X  	return;
X  
X      /* check the title bar buttons */
X***************
X*** 1899,1904 ****
X--- 2004,2016 ----
X  	ExecuteFunction(RootFunction, Action, Event.xany.window,
X  	    Tmp_win, &Event, Context, FALSE);
X  
X+         if (Scr->StayUpMenus)
X+         {
X+             /* pop down the menu, if any */
X+             if (ActiveMenu != NULL)
X+             PopDownMenu();
X+         } /* end if  */
X+ 
X  	RootFunction = NULL;
X  	return;
X      }
X***************
X*** 1917,1924 ****
X      RootFunction = NULL;
X      if (Scr->Mouse[Event.xbutton.button][Context][modifier].func == F_MENU)
X      {
X! 	do_menu (Scr->Mouse[Event.xbutton.button][Context][modifier].menu,
X! 		 (Window) None);
X      }
X      else if (Scr->Mouse[Event.xbutton.button][Context][modifier].func != NULL)
X      {
X--- 2029,2040 ----
X      RootFunction = NULL;
X      if (Scr->Mouse[Event.xbutton.button][Context][modifier].func == F_MENU)
X      {
X!         do_menu (Scr->Mouse[Event.xbutton.button][Context][modifier].menu,
X!             (Window) None);
X!         if (Scr->StayUpMenus)
X!         {
X!             GlobalMenuButton = False;
X!         } /* end if  */
X      }
X      else if (Scr->Mouse[Event.xbutton.button][Context][modifier].func != NULL)
X      {
X***************
X*** 1965,1970 ****
X--- 2081,2087 ----
X  } HENScanArgs;
X  
X  /* ARGSUSED*/
X+ 
X  static Bool
X  HENQueueScanner(dpy, ev, args)
X      Display *dpy;
Xdiff -c old/gram.y new/gram.y
X*** old/gram.y	Thu Nov 15 20:13:09 1990
X--- new/gram.y	Tue Apr 23 08:17:13 1991
X***************
X*** 87,93 ****
X  %token <num> START_ICONIFIED NO_TITLE_HILITE TITLE_HILITE
X  %token <num> MOVE RESIZE WAIT SELECT KILL LEFT_TITLEBUTTON RIGHT_TITLEBUTTON 
X  %token <num> NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD 
X! %token <num> SKEYWORD DKEYWORD JKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN
X  %token <num> NO_STACKMODE ICON_TITLE NO_ICON_TITLE
X  %token <ptr> STRING 
X  
X--- 87,93 ----
X  %token <num> START_ICONIFIED NO_TITLE_HILITE TITLE_HILITE
X  %token <num> MOVE RESIZE WAIT SELECT KILL LEFT_TITLEBUTTON RIGHT_TITLEBUTTON 
X  %token <num> NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD 
X! %token <num> SKEYWORD DKEYWORD JKEYWORD PKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN
X  %token <num> NO_STACKMODE ICON_TITLE NO_ICON_TITLE
X  %token <ptr> STRING 
X  
X***************
X*** 345,351 ****
X  		| pixmap_entries pixmap_entry
X  		;
X  
X! pixmap_entry	: TITLE_HILITE string { SetHighlightPixmap ($2); }
X  		;
X  
X  
X--- 345,351 ----
X  		| pixmap_entries pixmap_entry
X  		;
X  
X! pixmap_entry	:  PKEYWORD string { do_pixmap_keyword($1,$2); }
X  		;
X  
X  
Xdiff -c old/iconmgr.c new/iconmgr.c
X*** old/iconmgr.c	Thu Nov 15 20:13:10 1990
X--- new/iconmgr.c	Tue Apr 23 08:17:13 1991
X***************
X*** 499,504 ****
X--- 499,506 ----
X   ***********************************************************************
X   */
X  
X+ extern int FIXED_XmuCompareISOLatin1();
X+ 
X  void InsertInIconManager(ip, tmp, tmp_win)
X      IconMgr *ip;
X      WList *tmp;
X***************
X*** 506,512 ****
X  {
X      WList *tmp1;
X      int added;
X!     int (*compar)() = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
X  
X      added = FALSE;
X      if (ip->first == NULL)
X--- 508,514 ----
X  {
X      WList *tmp1;
X      int added;
X!     int (*compar)() = (Scr->CaseSensitive ? strcmp : FIXED_XmuCompareISOLatin1);
X  
X      added = FALSE;
X      if (ip->first == NULL)
X***************
X*** 655,661 ****
X  {
X      WList *tmp1, *tmp2;
X      int done;
X!     int (*compar)() = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
X  
X      if (ip == NULL)
X  	ip = Active->iconmgr;
X--- 657,663 ----
X  {
X      WList *tmp1, *tmp2;
X      int done;
X!     int (*compar)() = (Scr->CaseSensitive ? strcmp : FIXED_XmuCompareISOLatin1);
X  
X      if (ip == NULL)
X  	ip = Active->iconmgr;
Xdiff -c old/icons.c new/icons.c
X*** old/icons.c	Thu Nov 15 20:13:10 1990
X--- new/icons.c	Tue Apr 23 08:17:13 1991
X***************
X*** 26,31 ****
X--- 26,34 ----
X   * Icon releated routines
X   *
X   * $Log:	icons.c,v $
X+  * Revision 9.0  91/04/23  07:40:37  toml
X+  * Revision bump
X+  * 
X   * Revision 8.0  90/11/15  20:02:40  toml
X   * Revision bump
X   * 
Xdiff -c old/menus.c new/menus.c
X*** old/menus.c	Thu Nov 15 20:13:12 1990
X--- new/menus.c	Tue Apr 23 08:17:14 1991
X***************
X*** 33,38 ****
X--- 33,50 ----
X   * twm menu code
X   *
X   * $Log:	menus.c,v $
X+  * Revision 9.0  91/04/23  07:40:40  toml
X+  * Revision bump
X+  * 
X+  * Revision 8.3  91/04/15  09:13:24  toml
X+  * Remove version comment
X+  * 
X+  * Revision 8.2  90/12/29  16:39:35  toml
X+  * RJC patches
X+  * 
X+  * Revision 8.1  90/12/29  10:13:12  toml
X+  * StayUpMenus
X+  * 
X   * Revision 8.0  90/11/15  20:02:43  toml
X   * Revision bump
X   * 
X***************
X*** 82,91 ****
X--- 94,106 ----
X  #include "vdt.h"
X  #include "add_window.h"
X  #include "patchlevel.h"
X+ #include "malloc.h"
X+ #include <X11/Xmu/CharSet.h>
X  
X  extern XEvent Event;
X  
X  int RootFunction = NULL;
X+ 
X  MenuRoot *ActiveMenu = NULL;		/* the active menu */
X  MenuItem *ActiveItem = NULL;		/* the active menu item */
X  int MoveFunction;			/* either F_MOVE or F_FORCEMOVE */
X***************
X*** 116,121 ****
X--- 131,138 ----
X  extern char *InitFile;
X  static void Identify();
X  
X+ #define MAX(x,y) ((x)>(y)?(x):(y))
X+ 
X  #define SHADOWWIDTH 5			/* in pixels */
X  
X  /***********************************************************************
X***************
X*** 372,388 ****
X      int y_offset;
X      int text_y;
X      GC gc;
X  
X  #ifdef DEBUG_MENUS
X      fprintf(stderr, "Paint entry\n");
X  #endif
X      y_offset = mi->item_num * Scr->EntryHeight;
X-     text_y = y_offset + Scr->MenuFont.y;
X  
X      if (mi->func != F_TITLE)
X      {
X  	int x, y;
X  
X  	if (mi->state)
X  	{
X  	    XSetForeground(dpy, Scr->NormalGC, mi->hi_back);
X--- 389,409 ----
X      int y_offset;
X      int text_y;
X      GC gc;
X+     MyFont *font;
X  
X  #ifdef DEBUG_MENUS
X      fprintf(stderr, "Paint entry\n");
X  #endif
X      y_offset = mi->item_num * Scr->EntryHeight;
X  
X      if (mi->func != F_TITLE)
X      {
X  	int x, y;
X  
X+ 	font = &(Scr->MenuFont);
X+ 
X+ 	text_y = y_offset + font->y;
X+ 
X  	if (mi->state)
X  	{
X  	    XSetForeground(dpy, Scr->NormalGC, mi->hi_back);
X***************
X*** 390,396 ****
X  	    XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
X  		mr->width, Scr->EntryHeight);
X  
X! 	    FBF(mi->hi_fore, mi->hi_back, Scr->MenuFont.font->fid);
X  
X  	    XDrawString(dpy, mr->w, Scr->NormalGC, mi->x,
X  		text_y, mi->item, mi->strlen);
X--- 411,417 ----
X  	    XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
X  		mr->width, Scr->EntryHeight);
X  
X! 	    FBF(mi->hi_fore, mi->hi_back, font->font->fid);
X  
X  	    XDrawString(dpy, mr->w, Scr->NormalGC, mi->x,
X  		text_y, mi->item, mi->strlen);
X***************
X*** 406,412 ****
X  		XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
X  		    mr->width, Scr->EntryHeight);
X  
X! 		FBF(mi->fore, mi->back, Scr->MenuFont.font->fid);
X  		gc = Scr->NormalGC;
X  	    }
X  	    else
X--- 427,433 ----
X  		XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
X  		    mr->width, Scr->EntryHeight);
X  
X! 		FBF(mi->fore, mi->back, font->font->fid);
X  		gc = Scr->NormalGC;
X  	    }
X  	    else
X***************
X*** 426,432 ****
X  		    menu12_bits, menu12_width, menu12_height, 1, 0, 1);
X  	    }
X  	    x = mr->width - menu12_width - 5;
X! 	    y = y_offset + ((Scr->MenuFont.height - menu12_height) / 2);
X  	    XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
X  		menu12_width, menu12_height, x, y, 1);
X  	}
X--- 447,453 ----
X  		    menu12_bits, menu12_width, menu12_height, 1, 0, 1);
X  	    }
X  	    x = mr->width - menu12_width - 5;
X! 	    y = y_offset + ((font->height - menu12_height) / 2);
X  	    XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
X  		menu12_width, menu12_height, x, y, 1);
X  	}
X***************
X*** 435,440 ****
X--- 456,468 ----
X      {
X  	int y;
X  
X+ 	if (Scr->MenuTitleFont.name != NULL )
X+ 	    font = &(Scr->MenuTitleFont);
X+ 	else
X+ 	    font = &(Scr->MenuFont);
X+ 
X+ 	text_y = y_offset + font->y;
X+ 
X  	XSetForeground(dpy, Scr->NormalGC, mi->back);
X  
X  	/* fill the rectangle with the title background color */
X***************
X*** 441,448 ****
X--- 469,483 ----
X  	XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
X  	    mr->width, Scr->EntryHeight);
X  
X+ 	if ( Scr->MenuLineWidth > 0 ) /* note we loose the high efficiancy `0' line width */
X  	{
X  	    XSetForeground(dpy, Scr->NormalGC, mi->fore);
X+ 	    XSetLineAttributes(dpy,Scr->NormalGC,
X+ 			       Scr->MenuLineWidth,
X+ 			       LineSolid,
X+ 			       CapButt,
X+ 			       JoinMiter);
X+ 
X  	    /* now draw the dividing lines */
X  	    if (y_offset)
X  	      XDrawLine (dpy, mr->w, Scr->NormalGC, 0, y_offset,
X***************
X*** 449,457 ****
X  			 mr->width, y_offset);
X  	    y = ((mi->item_num+1) * Scr->EntryHeight)-1;
X  	    XDrawLine(dpy, mr->w, Scr->NormalGC, 0, y, mr->width, y);
X  	}
X  
X! 	FBF(mi->fore, mi->back, Scr->MenuFont.font->fid);
X  	/* finally render the title */
X  	XDrawString(dpy, mr->w, Scr->NormalGC, mi->x,
X  	    text_y, mi->item, mi->strlen);
X--- 484,497 ----
X  			 mr->width, y_offset);
X  	    y = ((mi->item_num+1) * Scr->EntryHeight)-1;
X  	    XDrawLine(dpy, mr->w, Scr->NormalGC, 0, y, mr->width, y);
X+ 	    XSetLineAttributes(dpy,Scr->NormalGC,
X+ 			       0,
X+ 			       LineSolid,
X+ 			       CapButt,
X+ 			       JoinMiter);
X  	}
X  
X! 	FBF(mi->fore, mi->back, font->font->fid);
X  	/* finally render the title */
X  	XDrawString(dpy, mr->w, Scr->NormalGC, mi->x,
X  	    text_y, mi->item, mi->strlen);
X***************
X*** 491,496 ****
X--- 531,537 ----
X      Window aJunkRoot,aJunkChild;
X      unsigned int aJunkMask;
X      int a_type;
X+     static int firstTime = True;
X  
X      while (TRUE)
X      {
X***************
X*** 499,506 ****
X  	{
X  	    a_type = Event.type;
X  	    if (!DispatchEvent ()) continue;
X! 	    if (a_type == ButtonRelease || Cancel)
X! 		return;
X  	}
X  
X  	/* if we haven't recieved the enter notify yet, wait */
X--- 540,572 ----
X  	{
X  	    a_type = Event.type;
X  	    if (!DispatchEvent ()) continue;
X! 	    /* if (a_type == ButtonRelease || Cancel)
X! 		return; */
X! 	    if (Event.type == ButtonRelease)
X! 	    {
X! 	        if (Scr->StayUpMenus)
X! 	        {
X! 		    if (firstTime == True)
X! 		    {
X! 		        /* it was the first release of the button */
X! 		        firstTime = False;
X! 		    } /* end if  */
X! 		    else
X! 		    {
X! 		        /* thats the second we need to return now */
X! 		        firstTime = True;
X! 		        return;
X! 		    } /* end else  */
X! 	        } /* end if  */
X! 	        else
X! 	        {
X! 		    return;
X! 	        } /* end else  */
X! 	    }
X! 
X! 	    if (Event.type ==  Cancel)
X! 	    return;
X! 
X  	}
X  
X  	/* if we haven't recieved the enter notify yet, wait */
X***************
X*** 682,687 ****
X--- 748,754 ----
X  {
X      MenuItem *tmp;
X      int width;
X+     MyFont *font;
X  
X  #ifdef DEBUG_MENUS
X      fprintf(stderr, "adding menu item=\"%s\", action=%s, sub=%d, f=%d\n",
X***************
X*** 711,718 ****
X      tmp->state = 0;
X      tmp->func = func;
X  
X      if (!Scr->HaveFonts) CreateFonts();
X!     width = XTextWidth(Scr->MenuFont.font, item, tmp->strlen);
X      if (width <= 0)
X  	width = 1;
X      if (width > menu->width)
X--- 778,790 ----
X      tmp->state = 0;
X      tmp->func = func;
X  
X+     if ( func == F_TITLE && Scr->MenuTitleFont.name != NULL)
X+ 	font= &(Scr->MenuTitleFont);
X+     else
X+ 	font= &(Scr->MenuFont);
X+ 
X      if (!Scr->HaveFonts) CreateFonts();
X!     width = XTextWidth(font->font, item, tmp->strlen);
X      if (width <= 0)
X  	width = 1;
X      if (width > menu->width)
X***************
X*** 767,775 ****
X      unsigned long valuemask;
X      XSetWindowAttributes attributes;
X      Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c;
X  
X-     Scr->EntryHeight = Scr->MenuFont.height + 4;
X- 
X      /* lets first size the window accordingly */
X      if (mr->mapped == NEVER_MAPPED)
X      {
X--- 839,858 ----
X      unsigned long valuemask;
X      XSetWindowAttributes attributes;
X      Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c;
X+     MyFont *titleFont; 
X+   
X+     if ( Scr->MenuTitleFont.name != NULL )
X+     {
X+  	Scr->EntryHeight = MAX(Scr->MenuFont.height,
X+  			       Scr->MenuTitleFont.height) + 4;
X+  	titleFont= &(Scr->MenuTitleFont);
X+     }
X+     else
X+     {
X+   	Scr->EntryHeight = Scr->MenuFont.height + 4;
X+ 	titleFont= &(Scr->MenuFont);
X+     }
X  
X      /* lets first size the window accordingly */
X      if (mr->mapped == NEVER_MAPPED)
X      {
X***************
X*** 786,792 ****
X  		cur->x = 5;
X  	    else
X  	    {
X! 		cur->x = width - XTextWidth(Scr->MenuFont.font, cur->item,
X  		    cur->strlen);
X  		cur->x /= 2;
X  	    }
X--- 869,875 ----
X  		cur->x = 5;
X  	    else
X  	    {
X! 		cur->x = width - XTextWidth(titleFont->font, cur->item,
X  		    cur->strlen);
X  		cur->x /= 2;
X  	    }
X***************
X*** 955,1048 ****
X   ***********************************************************************
X   */
X  
X  Bool PopUpMenu (menu, x, y, center)
X      MenuRoot *menu;
X      int x, y;
X      Bool center;
X  {
X!     if (!menu) return False;
X  
X!     InstallRootColormap();
X  
X!     if (menu == Scr->Windows)
X      {
X! 	TwmWindow *tmp_win;
X  
X! 	/* this is the twm windows menu,  let's go ahead and build it */
X  
X! 	DestroyMenu (menu);
X  
X! 	menu->first = NULL;
X! 	menu->last = NULL;
X! 	menu->items = 0;
X! 	menu->width = 0;
X! 	menu->mapped = NEVER_MAPPED;
X  
X! 	AddToMenu(menu, "TWM Windows", NULLSTR, NULL, F_TITLE,NULLSTR,NULLSTR);
X  	for (tmp_win = Scr->TwmRoot.next;
X  	     tmp_win != NULL;
X  	     tmp_win = tmp_win->next)
X! 	{
X  	    AddToMenu (menu, tmp_win->name, (char *) tmp_win, NULL, F_POPUP, 
X  		       NULLSTR, NULLSTR);
X! 	}
X! 	MakeMenu(menu);
X      }
X  
X!     if (menu->w == None || menu->items == 0) return False;
X  
X!     /* Prevent recursively bringing up menus. */
X!     if (menu->mapped == MAPPED) return False;
X  
X!     /*
X!      * Dynamically set the parent;  this allows pull-ups to also be main
X!      * menus, or to be brought up from more than one place.
X!      */
X!     menu->prev = ActiveMenu;
X  
X!     XGrabPointer(dpy, Scr->Root, True,
X! 	ButtonPressMask | ButtonReleaseMask,
X! 	GrabModeAsync, GrabModeAsync,
X! 	Scr->Root, Scr->MenuCursor, CurrentTime);
X  
X!     ActiveMenu = menu;
X!     menu->mapped = MAPPED;
X!     menu->entered = FALSE;
X  
X!     if (center) {
X! 	x -= (menu->width / 2);
X! 	y -= (Scr->EntryHeight / 2);	/* sticky menus would be nice here */
X!     }
X  
X!     /*
X!      * clip to screen
X!      */
X!     if (x + menu->width > Scr->MyDisplayWidth) {
X! 	x = Scr->MyDisplayWidth - menu->width;
X!     }
X!     if (x < 0) x = 0;
X!     if (y + menu->height > Scr->MyDisplayHeight) {
X! 	y = Scr->MyDisplayHeight - menu->height;
X!     }
X!     if (y < 0) y = 0;
X  
X!     MenuOrigins[MenuDepth].x = x;
X!     MenuOrigins[MenuDepth].y = y;
X!     MenuDepth++;
X  
X!     XMoveWindow(dpy, menu->w, x, y);
X!     if (Scr->Shadow) {
X! 	XMoveWindow (dpy, menu->shadow, x + SHADOWWIDTH, y + SHADOWWIDTH);
X!     }
X!     if (Scr->Shadow) {
X! 	XRaiseWindow (dpy, menu->shadow);
X!     }
X!     XMapRaised(dpy, menu->w);
X!     if (Scr->Shadow) {
X! 	XMapWindow (dpy, menu->shadow);
X!     }
X!     XSync(dpy, 0);
X!     return True;
X  }
X  
X  /***********************************************************************
X--- 1038,1168 ----
X   ***********************************************************************
X   */
X  
X+ extern int FIXED_XmuCompareISOLatin1();
X+ 
X  Bool PopUpMenu (menu, x, y, center)
X      MenuRoot *menu;
X      int x, y;
X      Bool center;
X  {
X!   TwmWindow **sortlist,*bakwin;
X!   int loop,curpos,count;
X!   int (*compar)() = (Scr->CaseSensitive ? strcmp : FIXED_XmuCompareISOLatin1);
X!   if (!menu) return False;
X  
X!   InstallRootColormap();
X  
X!   if (menu == Scr->Windows)
X      {
X!       TwmWindow *tmp_win;
X  
X!       /* this is the twm windows menu,  let's go ahead and build it */
X  
X!       DestroyMenu (menu);
X  
X!       menu->first = NULL;
X!       menu->last = NULL;
X!       menu->items = 0;
X!       menu->width = 0;
X!       menu->mapped = NEVER_MAPPED;
X  
X!       AddToMenu(menu, "TWM Windows", NULLSTR, NULL, F_TITLE,NULLSTR,NULLSTR);
X!       /* CODE to SORT THE MENU @@@@@@@@@@@@@@ */
X!       if (Scr->SortIconMgr)
X! 	{
X! 	  
X! 	  for(count=0,tmp_win=Scr->TwmRoot.next;
X! 	      tmp_win != NULL;
X! 	      tmp_win = tmp_win->next,count++);
X! 	  sortlist = (TwmWindow **)malloc(sizeof(TwmWindow *) * count);
X! 	  for(loop=0,tmp_win=Scr->TwmRoot.next;
X! 	      tmp_win != NULL;
X! 	      tmp_win = tmp_win->next,loop++)
X! 	    sortlist[loop]=tmp_win;
X! 	  
X! 	  /* Now that we have them in the list, just do an insertion sort. */
X! 	  for (curpos=1;curpos<count;curpos++) {
X! 	    /*Everything from 0 to curpos-1 is sorted.*/
X! 	    bakwin = sortlist[curpos];
X! 	    for (loop=curpos;(loop>0);loop--)
X! 	      /*Everything from loop to curpos is sorted*/
X! 	      /* Sort order is [0] = min, [n]=max */
X! 	      if (((*compar)(sortlist[loop-1]->name,bakwin->name))>0)
X! 		sortlist[loop]=sortlist[loop-1];
X! 	      else
X! 		break;
X! 	    sortlist[loop]=bakwin;
X! 	  }
X! 	  
X! 	  for(loop=0;loop<count;loop++) 
X! 	    AddToMenu(menu,sortlist[loop]->name, (char *)sortlist[loop], NULL, 
X! 		      F_POPUP,NULLSTR,NULLSTR);
X! 	}
X!       else 
X  	for (tmp_win = Scr->TwmRoot.next;
X  	     tmp_win != NULL;
X  	     tmp_win = tmp_win->next)
X! 	  {
X  	    AddToMenu (menu, tmp_win->name, (char *) tmp_win, NULL, F_POPUP, 
X  		       NULLSTR, NULLSTR);
X! 	  }
X!       MakeMenu(menu);
X      }
X  
X!   if (menu->w == None || menu->items == 0) return False;
X  
X!   /* Prevent recursively bringing up menus. */
X!   if (menu->mapped == MAPPED) return False;
X  
X!   /*
X!    * Dynamically set the parent;  this allows pull-ups to also be main
X!    * menus, or to be brought up from more than one place.
X!    */
X!   menu->prev = ActiveMenu;
X  
X!   XGrabPointer(dpy, Scr->Root, True,
X! 	       ButtonPressMask | ButtonReleaseMask,
X! 	       GrabModeAsync, GrabModeAsync,
X! 	       Scr->Root, Scr->MenuCursor, CurrentTime);
X  
X!   ActiveMenu = menu;
X!   menu->mapped = MAPPED;
X!   menu->entered = FALSE;
X  
X!   if (center) {
X!     x -= (menu->width / 2);
X!     y -= (Scr->EntryHeight / 2); /* sticky menus would be nice here */
X!   }
X  
X!   /*
X!    * clip to screen
X!    */
X!   if (x + menu->width > Scr->MyDisplayWidth) {
X!     x = Scr->MyDisplayWidth - menu->width;
X!   }
X!   if (x < 0) x = 0;
X!   if (y + menu->height > Scr->MyDisplayHeight) {
X!     y = Scr->MyDisplayHeight - menu->height;
X!   }
X!   if (y < 0) y = 0;
X  
X!   MenuOrigins[MenuDepth].x = x;
X!   MenuOrigins[MenuDepth].y = y;
X!   MenuDepth++;
X  
X!   XMoveWindow(dpy, menu->w, x, y);
X!   if (Scr->Shadow) {
X!     XMoveWindow (dpy, menu->shadow, x + SHADOWWIDTH, y + SHADOWWIDTH);
X!   }
X!   if (Scr->Shadow) {
X!     XRaiseWindow (dpy, menu->shadow);
X!   }
X!   XMapRaised(dpy, menu->w);
X!   if (Scr->Shadow) {
X!     XMapWindow (dpy, menu->shadow);
X!   }
X!   XSync(dpy, 0);
X!   return True;
X  }
X  
X  /***********************************************************************
X***************
X*** 1866,1874 ****
X  	    XUngrabServer (dpy);
X  	    XSync (dpy, 0);
X  	}
X! 	Execute(action);
X  	break;
X  
X      case F_UNFOCUS:
X  	FocusOnRoot();
X  	break;
X--- 1986,2005 ----
X  	    XUngrabServer (dpy);
X  	    XSync (dpy, 0);
X  	}
X! 	(void)Execute(action);
X  	break;
X  
X+     case F_TESTEXEC:
X+ 	PopDownMenu();
X+ 	if (!Scr->NoGrabServer) {
X+ 	    XUngrabServer (dpy);
X+ 	    XSync (dpy, 0);
X+ 	}
X+ 	do_next_action= (Execute(action)==0);
X+ 	if ( !do_next_action )
X+ 	    XBell(dpy,0);
X+ 	break;
X+ 
X      case F_UNFOCUS:
X  	FocusOnRoot();
X  	break;
X***************
X*** 2195,2201 ****
X   ***********************************************************************
X   */
X  
X! void
X  Execute(s)
X      char *s;
X  {
X--- 2326,2332 ----
X   ***********************************************************************
X   */
X  
X! int
X  Execute(s)
X      char *s;
X  {
X***************
X*** 2205,2210 ****
X--- 2336,2342 ----
X      char oldDisplay[256];
X      char *doisplay;
X      int restorevar = 0;
X+     int status;
X  
X      oldDisplay[0] = '\0';
X      doisplay=getenv("DISPLAY");
X***************
X*** 2229,2240 ****
X  	restorevar = 1;
X      }
X  
X!     (void) system (s);
X  
X      if (restorevar) {		/* why bother? */
X  	(void) sprintf (buf, "DISPLAY=%s", oldDisplay);
X  	putenv (buf);
X      }
X  }
X  
X  /***********************************************************************
X--- 2361,2378 ----
X  	restorevar = 1;
X      }
X  
X!     status=system (s);
X  
X+     /* this next bit may be horribly BSD specific. */
X+     if ( (status&0xff) == 0 )
X+ 	status = (status &0xff00) >> 8;
X+ 
X      if (restorevar) {		/* why bother? */
X  	(void) sprintf (buf, "DISPLAY=%s", oldDisplay);
X  	putenv (buf);
X      }
X+ 
X+     return status;
X  }
X  
X  /***********************************************************************
X***************
X*** 2439,2444 ****
X--- 2577,2583 ----
X      n = 0;
X      (void) sprintf(Info[n++], "tvtwm version:  %s", Version);
X      (void) sprintf(Info[n++], "Patchlevel %d", PATCHLEVEL);
X+ 
X      Info[n++][0] = '\0';
X  
X      if (t) {
Xdiff -c old/menus.h new/menus.h
X*** old/menus.h	Thu Nov 15 20:13:12 1990
X--- new/menus.h	Tue Apr 23 08:17:15 1991
X***************
X*** 148,154 ****
X  extern Bool AddFuncKey();
X  extern int ExecuteFunction();
X  extern int DeferExecution();
X! extern void Execute();
X  extern void FocusOnRoot();
X  
X  #endif /* _MENUS_ */
X--- 148,154 ----
X  extern Bool AddFuncKey();
X  extern int ExecuteFunction();
X  extern int DeferExecution();
X! extern int Execute();
X  extern void FocusOnRoot();
X  
X  #endif /* _MENUS_ */
Xdiff -c old/move.c new/move.c
X*** old/move.c	Thu Nov 15 20:13:13 1990
X--- new/move.c	Tue Apr 23 08:17:15 1991
X***************
X*** 170,179 ****
X--- 170,185 ----
X      int junkxroot, junkyroot;
X      unsigned int junkMask;
X      int first;
X+     XSetWindowAttributes attr;
X  
X      if (!Scr->NoGrabServer || !Scr->OpaqueMove)
X  	XGrabServer(dpy);
X  
X+     if (Scr->OpaqueMove) {
X+ 	attr.save_under = True;
X+ 	XChangeWindowAttributes(dpy, window, CWSaveUnder, &attr);
X+     }
X+ 	
X      if (!adding) {
X  	XGrabPointer(dpy, Scr->Root, True,
X  	    PointerMotionMask | EnterWindowMask | LeaveWindowMask | ButtonPressMask | ButtonReleaseMask,
X***************
X*** 280,285 ****
X--- 286,296 ----
X  
X      if (*cancel)
X  	WindowMoved = False;
X+ 
X+     if (Scr->OpaqueMove) {
X+ 	attr.save_under = False;
X+ 	XChangeWindowAttributes(dpy, window, CWSaveUnder, &attr);
X+     }
X  }
X  
X  /***********************************************************************
X***************
X*** 344,349 ****
X--- 355,361 ----
X      int deltax, deltay;
X      int vdtx, vdty;
X      char str[20];
X+     Window actual, virtual;
X  
X      dragX = x_root;
X      dragY = y_root;
X***************
X*** 373,384 ****
X  	    yt = vdty + Scr->MyDisplayHeight - dragHeight;
X      }
X  
X!     if (panner==IN_PANNER) {
X!       if (Scr->OpaqueMove)
X! 	XMoveWindow(dpy,tmp_win->frame,xl*Scr->PannerScale,yt*Scr->PannerScale);
X!     } else
X!       if (!tmp_win->sticky)
X!   	XMoveWindow(dpy,tmp_win->virtualWindow,xl/Scr->PannerScale,yt/Scr->PannerScale);
X      if (Scr->OpaqueMove)
X  	XMoveWindow(dpy, window, xl, yt);
X      else
X--- 385,417 ----
X  	    yt = vdty + Scr->MyDisplayHeight - dragHeight;
X      }
X  
X!     if (Scr->VirtualDesktop && Scr->OpaqueMove && !tmp_win->sticky) {
X! 	if (panner == IN_PANNER) {
X! 	    if (window == tmp_win->virtualWindow) {
X! 		actual = tmp_win->frame;
X! 		virtual = tmp_win->virtualWindow;
X! 	    }
X! 	    else {
X! 		actual = tmp_win->icon_w;
X! 		virtual = tmp_win->virtualIcon;
X! 	    }
X! 	}
X! 	else {
X! 	    if (window == tmp_win->frame) {
X! 		actual = tmp_win->frame;
X! 		virtual = tmp_win->virtualWindow;
X! 	    }
X! 	    else {
X! 		actual = tmp_win->icon_w;
X! 		virtual = tmp_win->virtualIcon;
X! 	    }
X! 	}
X! 	if (panner == IN_PANNER)
X! 	    XMoveWindow(dpy, actual, xl*Scr->PannerScale, yt*Scr->PannerScale);
X! 	else
X! 	    XMoveWindow(dpy, virtual, xl/Scr->PannerScale, yt/Scr->PannerScale);
X!     }
X! 
X      if (Scr->OpaqueMove)
X  	XMoveWindow(dpy, window, xl, yt);
X      else
X***************
X*** 400,406 ****
X  {
X      Window junkChild;
X      int doingFine;
X!     XEvent event;
X      int xdest, ydest;
X      unsigned mask;
X      static int buttons;
X--- 433,439 ----
X  {
X      Window junkChild;
X      int doingFine;
X!     XEvent event,bakevent;
X      int xdest, ydest;
X      unsigned mask;
X      static int buttons;
X***************
X*** 412,418 ****
X  
X      doingFine = True;
X      while (doingFine) {
X! 	XMaskEvent(dpy, ButtonPressMask|ButtonReleaseMask|PointerMotionMask|EnterWindowMask|LeaveWindowMask, &event);
X  	switch (event.type) {
X  	    case ButtonPress:
X  		if (pulldown) {
X--- 445,451 ----
X  
X      doingFine = True;
X      while (doingFine) {
X! 	XNextEvent(dpy, &event);
X  	switch (event.type) {
X  	    case ButtonPress:
X  		if (pulldown) {
X***************
X*** 454,459 ****
X--- 487,504 ----
X  		    ButtonPressed = -1;
X                      *done = True;
X  		    doingFine = False;
X+ 
X+ 		    /* RJC: added code to do a final move here */
X+ 		    if (!WindowMoved &&
X+ 			(abs(event.xbutton.x_root - rootX) >= Scr->MoveDelta ||
X+ 			 abs(event.xbutton.y_root - rootY) >= Scr->MoveDelta))
X+ 			{
X+ 			    WindowMoved = True;
X+ 			}
X+ 		    if (WindowMoved) {
X+ 		        *x_root = event.xbutton.x_root + offsetX;
X+ 			*y_root = event.xbutton.y_root + offsetY;
X+ 		    }
X  		}
X  		break;
X  	    case EnterNotify:
X***************
X*** 489,494 ****
X--- 534,546 ----
X  		    doingFine = False;
X  		}
X  		break;
X+ 	      default: bakevent = Event;
X+ 		       Event=event;
X+ 		       DispatchEvent();
X+ 		       Event=bakevent;
X  	}
X      }
X  }
X+ 
X+ 
X+ 
Xdiff -c old/parse.c new/parse.c
X*** old/parse.c	Thu Nov 15 20:13:14 1990
X--- new/parse.c	Tue Apr 23 08:17:15 1991
X***************
X*** 42,47 ****
X--- 42,48 ----
X  #endif
X  
X  #include <stdio.h>
X+ #include <ctype.h>
X  #include <X11/Xos.h>
X  #include <X11/Xmu/CharSet.h>
X  #include "twm.h"
X***************
X*** 226,231 ****
X--- 227,241 ----
X   ***********************************************************************
X   */
X  
X+ #define MAX_INCLUDES 10
X+ 
X+ static struct incl {
X+      FILE *fp;
X+      char *name;
X+      int lineno;
X+ } rc_includes[MAX_INCLUDES];
X+ static int include_file = 0;
X+ 
X  static int twmFileInput()
X  {
X      if (overflowlen) return (int) overflowbuff[--overflowlen];
X***************
X*** 232,242 ****
X  
X      while (ptr == len)
X      {
X! 	if (fgets(buff, BUF_LEN, twmrc) == NULL)
X! 	    return NULL;
X  
X  	yylineno++;
X  
X  	ptr = 0;
X  	len = strlen(buff);
X      }
X--- 242,288 ----
X  
X      while (ptr == len)
X      {
X! 	while (include_file) {
X! 	     if (fgets(buff, BUF_LEN, rc_includes[include_file].fp) == NULL) {
X! 		  free(rc_includes[include_file].name); 
X! 		  fclose(rc_includes[include_file].fp);
X! 		  yylineno = rc_includes[include_file--].lineno;
X! 	     } else 
X! 		  break; 
X! 	}
X! 	if (!include_file)
X! 	     if (fgets(buff, BUF_LEN, twmrc) == NULL)
X! 		  return NULL;
X  
X  	yylineno++;
X  
X+ 	if (strncmp(buff, "include", 7) == 0) {
X+ 	     /* Whoops, an include file! */
X+ 	     char *p = buff + 7, *q;
X+ 	     FILE *fp;
X+ 	     
X+ 	     while (isspace(*p)) p++;
X+ 	     for (q = p; *q && !isspace(*q); q++)
X+ 		  continue;
X+ 	     *q = 0;
X+ 
X+ 	     if ((fp = fopen(p, "r")) == NULL) {
X+ 		  fprintf(stderr, "%s: Unable to open included init file %s\n", 
X+ 			  ProgramName, p);
X+ 		  continue;
X+ 	     }
X+ 	     if (++include_file >= MAX_INCLUDES) {
X+ 		  fprintf(stderr, "%s: init file includes nested too deep\n",
X+ 			  ProgramName);
X+ 		  continue;
X+ 	     }
X+ 	     rc_includes[include_file].fp = fp;
X+ 	     rc_includes[include_file].lineno = yylineno;
X+ 	     yylineno = 0;
X+ 	     rc_includes[include_file].name = malloc(strlen(p)+1);
X+ 	     strcpy(rc_includes[include_file].name, p);
X+ 	     continue;
X+ 	}
X  	ptr = 0;
X  	len = strlen(buff);
X      }
X***************
X*** 342,347 ****
X--- 388,395 ----
X  #define kw0_WarpUnmapped		25
X  #define kw0_ShowVirtualNames		26
X  #define kw0_StickyAbove			27
X+ #define kw0_StayUpMenus			28
X+ #define kw0_PannerOpaqueScroll		29
X  
X  #define kws_UsePPosition		1
X  #define kws_IconFont			2
X***************
X*** 355,363 ****
X  #define kws_VirtualDesktop		10
X  #define kws_PannerState			11
X  #define kws_PannerGeometry		12
X- #define kws_VirtualDesktopBackgroundPixmap 13
X- #define kws_PannerBackgroundPixmap	14
X  #define kws_VirtualFont			15
X  
X  #define kwn_ConstrainedMoveTime		1
X  #define kwn_MoveDelta			2
X--- 403,410 ----
X  #define kws_VirtualDesktop		10
X  #define kws_PannerState			11
X  #define kws_PannerGeometry		12
X  #define kws_VirtualFont			15
X+ #define kws_MenuTitleFont               16
X  
X  #define kwn_ConstrainedMoveTime		1
X  #define kwn_MoveDelta			2
X***************
X*** 371,376 ****
X--- 418,425 ----
X  #define kwn_PannerScale			10
X  #define kwn_ScrollDistanceX		11
X  #define kwn_ScrollDistanceY		12
X+ #define kwn_MenuLineWidth               13
X+ #define kwn_TitleFontPadding            14
X  
X  #define kwcl_BorderColor		1
X  #define kwcl_IconManagerHighlight	2
X***************
X*** 398,403 ****
X--- 447,457 ----
X  #define kwc_PannerForeground		10
X  #define kwc_PannerBackground		11
X  
X+ #define kwp_TitleHighlight              1
X+ #define kwp_TitleHighlightLeft          2
X+ #define kwp_TitleHighlightRight         3
X+ #define kwp_PannerBackgroundPixmap      4
X+ #define kwp_VirtualDesktopBackgroundPixmap 5
X  
X  /*
X   * The following is sorted alphabetically according to name (which must be
X***************
X*** 492,497 ****
X--- 546,552 ----
X      { "f.sorticonmgr",		FKEYWORD, F_SORTICONMGR },
X      { "f.source",		FSKEYWORD, F_BEEP },  /* XXX - don't work */
X      { "f.stick",		FKEYWORD, F_STICK },
X+     { "f.test",                 FKEYWORD, F_TESTEXEC },
X      { "f.title",		FKEYWORD, F_TITLE },
X      { "f.topzoom",		FKEYWORD, F_TOPZOOM },
X      { "f.twmrc",		FKEYWORD, F_RESTART },
X***************
X*** 543,550 ****
X--- 598,607 ----
X      { "menubackground",		CKEYWORD, kwc_MenuBackground },
X      { "menufont",		SKEYWORD, kws_MenuFont },
X      { "menuforeground",		CKEYWORD, kwc_MenuForeground },
X+     { "menulinewidth",		NKEYWORD, kwn_MenuLineWidth },
X      { "menushadowcolor",	CKEYWORD, kwc_MenuShadowColor },
X      { "menutitlebackground",	CKEYWORD, kwc_MenuTitleBackground },
X+     { "menutitlefont",		SKEYWORD, kws_MenuTitleFont },
X      { "menutitleforeground",	CKEYWORD, kwc_MenuTitleForeground },
X      { "meta",			META, 0 },
X      { "mod",			META, 0 },  /* fake it */
X***************
X*** 572,580 ****
X      { "noversion",		KEYWORD, kw0_NoVersion },
X      { "opaquemove",		KEYWORD, kw0_OpaqueMove },
X      { "pannerbackground",	CKEYWORD, kwc_PannerBackground },
X!     { "pannerbackgroundpixmap",	SKEYWORD, kws_PannerBackgroundPixmap },
X      { "pannerforeground",	CKEYWORD, kwc_PannerForeground },
X      { "pannergeometry",		SKEYWORD, kws_PannerGeometry },
X      { "pannerscale",		NKEYWORD, kwn_PannerScale },
X      { "pannerstate",		SKEYWORD, kws_PannerState },
X      { "pixmaps",		PIXMAPS, 0 },
X--- 629,638 ----
X      { "noversion",		KEYWORD, kw0_NoVersion },
X      { "opaquemove",		KEYWORD, kw0_OpaqueMove },
X      { "pannerbackground",	CKEYWORD, kwc_PannerBackground },
X!     { "pannerbackgroundpixmap",	PKEYWORD, kwp_PannerBackgroundPixmap },
X      { "pannerforeground",	CKEYWORD, kwc_PannerForeground },
X      { "pannergeometry",		SKEYWORD, kws_PannerGeometry },
X+     { "panneropaquescroll",       KEYWORD, kw0_PannerOpaqueScroll },
X      { "pannerscale",		NKEYWORD, kwn_PannerScale },
X      { "pannerstate",		SKEYWORD, kws_PannerState },
X      { "pixmaps",		PIXMAPS, 0 },
X***************
X*** 597,602 ****
X--- 655,661 ----
X      { "south",			DKEYWORD, D_SOUTH },
X      { "squeezetitle",		SQUEEZE_TITLE, 0 },
X      { "starticonified",		START_ICONIFIED, 0 },
X+     { "stayupmenus",		KEYWORD, kw0_StayUpMenus },
X      { "sticky",			STICKY, 0 },
X      { "stickyabove",		KEYWORD, kw0_StickyAbove },
X      { "t",			TITLE, 0 },
X***************
X*** 604,611 ****
X      { "titlebackground",	CLKEYWORD, kwcl_TitleBackground },
X      { "titlebuttonborderwidth",	NKEYWORD, kwn_TitleButtonBorderWidth },
X      { "titlefont",		SKEYWORD, kws_TitleFont },
X      { "titleforeground",	CLKEYWORD, kwcl_TitleForeground },
X!     { "titlehighlight",		TITLE_HILITE, 0 },
X      { "titlepadding",		NKEYWORD, kwn_TitlePadding },
X      { "unknownicon",		SKEYWORD, kws_UnknownIcon },
X      { "usepposition",		SKEYWORD, kws_UsePPosition },
X--- 663,673 ----
X      { "titlebackground",	CLKEYWORD, kwcl_TitleBackground },
X      { "titlebuttonborderwidth",	NKEYWORD, kwn_TitleButtonBorderWidth },
X      { "titlefont",		SKEYWORD, kws_TitleFont },
X+     { "titlefontpadding",       NKEYWORD, kwn_TitleFontPadding },
X      { "titleforeground",	CLKEYWORD, kwcl_TitleForeground },
X!     { "titlehighlight",		PKEYWORD, kwp_TitleHighlight },
X!     { "titlehighlightleft",	PKEYWORD, kwp_TitleHighlightLeft },
X!     { "titlehighlightright",	PKEYWORD, kwp_TitleHighlightRight },
X      { "titlepadding",		NKEYWORD, kwn_TitlePadding },
X      { "unknownicon",		SKEYWORD, kws_UnknownIcon },
X      { "usepposition",		SKEYWORD, kws_UsePPosition },
X***************
X*** 612,619 ****
X      { "virtualbackground",	CLKEYWORD, kwcl_VirtualBackground },
X      { "virtualdesktop",		SKEYWORD, kws_VirtualDesktop },
X      { "virtualdesktopbackground",CKEYWORD, kwc_VirtualDesktopBackground },
X!     { "virtualdesktopbackgroundpixmap",SKEYWORD,
X! 				    kws_VirtualDesktopBackgroundPixmap },
X      { "virtualdesktopforeground",CKEYWORD, kwc_VirtualDesktopForeground },
X      { "virtualfont",		SKEYWORD, kws_VirtualFont },
X      { "virtualforeground",	CLKEYWORD, kwcl_VirtualForeground },
X--- 674,681 ----
X      { "virtualbackground",	CLKEYWORD, kwcl_VirtualBackground },
X      { "virtualdesktop",		SKEYWORD, kws_VirtualDesktop },
X      { "virtualdesktopbackground",CKEYWORD, kwc_VirtualDesktopBackground },
X!     { "virtualdesktopbackgroundpixmap",PKEYWORD,
X! 				    kwp_VirtualDesktopBackgroundPixmap },
X      { "virtualdesktopforeground",CKEYWORD, kwc_VirtualDesktopForeground },
X      { "virtualfont",		SKEYWORD, kws_VirtualFont },
X      { "virtualforeground",	CLKEYWORD, kwcl_VirtualForeground },
X***************
X*** 673,678 ****
X--- 735,744 ----
X  	Scr->StickyAbove = TRUE;
X  	return 1;
X  
X+       case kw0_PannerOpaqueScroll:
X+ 	Scr->PannerOpaqueScroll = TRUE;
X+ 	return 1;
X+ 
X        case kw0_AutoRelativeResize:
X  	Scr->AutoRelativeResize = TRUE;
X  	return 1;
X***************
X*** 761,766 ****
X--- 827,836 ----
X  	Scr->ShowVirtualNames = TRUE;
X  	return 1;
X  
X+       case kw0_StayUpMenus:
X+ 	if (Scr->FirstTime) Scr->StayUpMenus = TRUE;
X+ 	return 1;
X+ 
X        case kw0_NoCaseSensitive:
X  	Scr->CaseSensitive = FALSE;
X  	return 1;
X***************
X*** 783,796 ****
X      char *s;
X  {
X      switch (keyword) {
X-       case kws_VirtualDesktopBackgroundPixmap:
X- 	Scr->vdtPixmap = s;
X- 	return 1;
X  
X-       case kws_PannerBackgroundPixmap:
X- 	Scr->PannerPixmap = s;
X- 	return 1;
X- 
X        case kws_VirtualDesktop:
X  	{
X  	    int status, x, y;
X--- 853,859 ----
X***************
X*** 867,872 ****
X--- 930,939 ----
X  	if (!Scr->HaveFonts) Scr->MenuFont.name = s;
X  	return 1;
X  
X+       case kws_MenuTitleFont:
X+ 	if (!Scr->HaveFonts) Scr->MenuTitleFont.name = s; 
X+ 	return 1;
X+ 
X        case kws_TitleFont:
X  	if (!Scr->HaveFonts) Scr->TitleBarFont.name = s;
X  	return 1;
X***************
X*** 929,934 ****
X--- 996,1009 ----
X  	ConstrainedMoveTime = num;
X  	return 1;
X  
X+       case kwn_MenuLineWidth:
X+ 	Scr->MenuLineWidth = num;
X+ 	return 1;
X+ 
X+       case kwn_TitleFontPadding:
X+ 	Scr->TitleFontPadding = num;
X+ 	return 1;
X+ 
X        case kwn_MoveDelta:
X  	Scr->MoveDelta = num;
X  	return 1;
X***************
X*** 1085,1090 ****
X--- 1160,1223 ----
X      return 0;
X  }
X  
X+ int do_pixmap_keyword(keyword, filename)
X+     int keyword;
X+     char *filename;
X+ 
X+ {
X+ Pixmap pm;
X+ 
X+ switch(keyword)
X+     {
X+ 
X+  case kwp_TitleHighlight:
X+     pm = GetBitmap (filename);
X+ 
X+     if (pm) {
X+ 	if (Scr->hilitePm) {
X+ 	    XFreePixmap (dpy, Scr->hilitePm);
X+ 	}
X+ 	Scr->hilitePm = pm;
X+ 	Scr->hilite_pm_width = JunkWidth;
X+ 	Scr->hilite_pm_height = JunkHeight;
X+     }
X+     return 1;
X+ 
X+  case kwp_TitleHighlightLeft:
X+     pm = GetBitmap (filename);
X+     if (pm) {
X+ 	if (Scr->hiliteLeftPm) {
X+ 	    XFreePixmap (dpy, Scr->hiliteLeftPm);
X+ 	}
X+ 	Scr->hiliteLeftPm = pm;
X+ 	Scr->hilite_left_pm_width = JunkWidth;
X+ 	Scr->hilite_left_pm_height = JunkHeight;
X+     }
X+     return 1;
X+ 
X+  case kwp_TitleHighlightRight:
X+     pm = GetBitmap (filename);
X+     if (pm) {
X+ 	if (Scr->hiliteRightPm) {
X+ 	    XFreePixmap (dpy, Scr->hiliteRightPm);
X+ 	}
X+ 	Scr->hiliteRightPm = pm;
X+ 	Scr->hilite_right_pm_width = JunkWidth;
X+ 	Scr->hilite_right_pm_height = JunkHeight;
X+     }
X+     return 1;
X+ 
X+  case kwp_PannerBackgroundPixmap:
X+     Scr->PannerPixmap = filename;
X+     return 1;
X+ 
X+  case kwp_VirtualDesktopBackgroundPixmap:
X+     Scr->vdtPixmap = filename;
X+     return 1;
X+ 
X+     }
X+     return 0;
X+ }
X  
X  static int ParseUsePPosition (s)
X      register char *s;
Xdiff -c old/parse.h new/parse.h
X*** old/parse.h	Thu Nov 15 20:13:14 1990
X--- new/parse.h	Tue Apr 23 08:17:15 1991
X***************
X*** 110,115 ****
X--- 110,116 ----
X  #define F_WARPTOSCREEN		109	/* string */
X  #define F_COLORMAP		110	/* string */
X  #define F_SCROLL		111	/* string */
X+ #define F_TESTEXEC              112     /* string */
X  
X  #define D_NORTH			1
X  #define D_SOUTH			2
Xdiff -c old/patchlevel.h new/patchlevel.h
X*** old/patchlevel.h	Thu Nov 15 20:13:14 1990
X--- new/patchlevel.h	Tue Apr 23 08:17:15 1991
X***************
X*** 1 ****
X! #define PATCHLEVEL 4
X--- 1 ----
X! #define PATCHLEVEL 5
Xdiff -c old/resize.c new/resize.c
X*** old/resize.c	Thu Nov 15 20:13:15 1990
X--- new/resize.c	Tue Apr 23 08:17:16 1991
X***************
X*** 33,38 ****
X--- 33,47 ----
X   * window resizing borrowed from the "wm" window manager
X   *
X   * $Log:	resize.c,v $
X+  * Revision 9.0  91/04/23  07:40:45  toml
X+  * Revision bump
X+  * 
X+  * Revision 8.2  90/12/29  16:39:40  toml
X+  * RJC patches
X+  * 
X+  * Revision 8.1  90/12/29  10:33:36  toml
X+  * zoom commands now obey size hints
X+  * 
X   * Revision 8.0  90/11/15  20:02:49  toml
X   * Revision bump
X   * 
X***************
X*** 810,815 ****
X--- 819,825 ----
X       */
X      if (tmp_win->title_height && tmp_win->hilite_w)
X      {
X+ 
X  	xwc.width = (tmp_win->rightx - tmp_win->highlightx);
X  	if (Scr->TBInfo.nright > 0) xwc.width -= Scr->TitlePadding;
X          if (xwc.width <= 0) {
X***************
X*** 821,826 ****
X--- 831,838 ----
X  
X          xwcm = CWX | CWWidth;
X          XConfigureWindow(dpy, tmp_win->hilite_w, xwcm, &xwc);
X+ 
X+ 
X      }
X  
X  #ifdef SHAPE
X***************
X*** 973,1002 ****
X      if (!Scr->NoRaiseResize)
X          RaiseFrame(dpy, tmp_win);
X  
X!     dragHeight -= tmp_win->title_height;
X! 
X!     if (tmp_win->hints.flags&PMinSize && tmp_win->hints.flags & PResizeInc)
X!     {
X!         dragWidth -= tmp_win->hints.min_width;
X!         dragHeight -= tmp_win->hints.min_height;
X!     }
X! 
X!     if (tmp_win->hints.flags & PResizeInc)
X!     {
X!         dragWidth /= tmp_win->hints.width_inc;
X!         dragHeight /= tmp_win->hints.height_inc;
X! 
X!         dragWidth *= tmp_win->hints.width_inc;
X!         dragHeight *= tmp_win->hints.height_inc;
X!     }
X! 
X!     if (tmp_win->hints.flags&PMinSize && tmp_win->hints.flags & PResizeInc)
X!     {
X!         dragWidth += tmp_win->hints.min_width;
X!         dragHeight += tmp_win->hints.min_height;
X!     }
X! 
X!     dragHeight += tmp_win->title_height;
X  
X      SetupWindow (tmp_win, dragx , dragy , dragWidth, dragHeight, -1);
X      XUngrabPointer (dpy, CurrentTime);
X--- 985,991 ----
X      if (!Scr->NoRaiseResize)
X          RaiseFrame(dpy, tmp_win);
X  
X!     ConstrainSize(tmp_win, &dragWidth, &dragHeight);
X  
X      SetupWindow (tmp_win, dragx , dragy , dragWidth, dragHeight, -1);
X      XUngrabPointer (dpy, CurrentTime);
Xdiff -c old/screen.h new/screen.h
X*** old/screen.h	Thu Nov 15 20:13:15 1990
X--- new/screen.h	Tue Apr 23 08:17:16 1991
X***************
X*** 90,97 ****
X      Pixmap siconifyPm;		/* the icon manager iconify pixmap */
X      Pixmap pullPm;		/* pull right menu arrow */
X      Pixmap hilitePm;		/* focus highlight window background */
X-     Pixmap rootWeave;		/* root weave pixmap */
X      int hilite_pm_width, hilite_pm_height;  /* cache the size */
X  
X      MenuRoot *MenuList;		/* head of the menu list */
X      MenuRoot *LastMenu;		/* the last menu (mostly unused?) */
X--- 90,101 ----
X      Pixmap siconifyPm;		/* the icon manager iconify pixmap */
X      Pixmap pullPm;		/* pull right menu arrow */
X      Pixmap hilitePm;		/* focus highlight window background */
X      int hilite_pm_width, hilite_pm_height;  /* cache the size */
X+     Pixmap hiliteLeftPm;	/* focus highlight window left end */
X+     int hilite_left_pm_width, hilite_left_pm_height;  /* cache the size */
X+     Pixmap hiliteRightPm;	/* focus highlight window right end */
X+     int hilite_right_pm_width, hilite_right_pm_height;  /* cache the size */
X+     Pixmap rootWeave;		/* root weave pixmap */
X  
X      MenuRoot *MenuList;		/* head of the menu list */
X      MenuRoot *LastMenu;		/* the last menu (mostly unused?) */
X***************
X*** 202,207 ****
X--- 206,212 ----
X      unsigned long XORvalue;	/* number to use when drawing xor'ed */
X      MyFont TitleBarFont;	/* title bar font structure */
X      MyFont MenuFont;		/* menu font structure */
X+     MyFont MenuTitleFont;	/* menu title font structure */
X      MyFont IconFont;		/* icon font structure */
X      MyFont SizeFont;		/* resize font structure */
X      MyFont IconManagerFont;	/* window list font structure */
X***************
X*** 220,226 ****
X--- 225,233 ----
X      int TitleHeight;		/* height of the title bar window */
X      TwmWindow *Focus;		/* the twm window that has focus */
X      int EntryHeight;		/* menu entry height */
X+     int MenuLineWidth;		/* the width of menu lines 0 means no bars */
X      int FramePadding;		/* distance between decorations and border */
X+     int TitleFontPadding;      	/* additional width to add to font height */
X      int TitlePadding;		/* distance between items in titlebar */
X      int ButtonIndent;		/* amount to shrink buttons on each side */
X      int NumAutoRaises;		/* number of autoraise windows on screen */
X***************
X*** 265,270 ****
X--- 272,278 ----
X      short WarpUnmapped;		/* allow warping to unmapped windows */
X      short PannerState;		/* the initial state of the panner */
X      short PannerScale;		/* scale of the panner */
X+     short PannerOpaqueScroll;   /* When you scroll in the panner, is it opaque? */
X      char *PannerGeometry;	/* geometry of the panner */
X      int PannerOutlineWidth;
X      int PannerOutlineHeight;
X***************
X*** 277,282 ****
X--- 285,291 ----
X      short PannerBackgroundSet;	/* background of panner is set */
X      char *PannerPixmap;		/* Panner pixmap */
X      short StickyAbove;		/* should sticky windows be above? */
X+     short StayUpMenus; 		/* do the menus stay up upon release of button ? */
X  
X      FuncKey FuncKeyRoot;
X  } ScreenInfo;
Xdiff -c old/tvtwm.man new/tvtwm.man
X*** old/tvtwm.man	Thu Nov 15 20:13:17 1990
X--- new/tvtwm.man	Tue Apr 23 08:17:17 1991
X***************
X*** 608,613 ****
X--- 608,615 ----
X  menus, and
X  can only be specified inside of a 
X  \fBColor\fP or \fBMonochrome\fP list.  The default is "white".
X+ .IP "\fBMenuTitleFont\fP \fIstring\fP" 8
X+ This variable specifies the font to be used in menu titles.
X  .IP "\fBMenuTitleForeground\fP \fIstring\fP" 8
X  This variable specifies the foreground color for \fBf.title\fP entries in
X  menus and
X***************
X*** 715,720 ****
X--- 717,726 ----
X  .IP "\fBPannerGeometry\fP \fIstring\fP" 8
X  This variable specifies the position of the Virtual Desktop panner.
X  The default geometry is "-0-0".
X+ .IP \"fBPannerOpaqueScroll\fP" 8
X+ This variable causes the panner to scroll the Virtual Desktop
X+ opaquely.  This variable only takes effect if the \fBStickyAbove\fP
X+ variable is also set.
X  .IP "\fBPannerScale\fP \fIscale\fP" 8
X  This variable specifies that scale of the Virtual Desktop Panner
X  in relation to the actual screen.  The default scale is 20.
X***************
X*** 804,809 ****
X--- 810,819 ----
X  is given, only those windows will be started iconic.  This is useful for
X  programs that do not support an \fI-iconic\fP command line option or
X  resource.
X+ .IP \"fBStayUpMenus" 8
X+ This variable alters menu interaction.  By default, a menu item is selected
X+ when a mouse button is released over it.  This variable causes menu itmes to
X+ be selected on the next button press event.
X  .IP "\fBSticky\fP [{ \fIwin-list\fP }]" 8
X  This variable is a list of client windows that will be sticky
X  by default.  See the \fBVIRTUAL DESKTOP\fP section for a full
X***************
X*** 825,830 ****
X--- 835,843 ----
X  .IP "\fBTitleFont\fP \fIstring\fP" 8
X  This variable specifies the font to used for displaying window names in
X  titlebars.  The default is "8x13".
X+ .IP "\fBTitleFontPadding\fP \fIpixels\fP" 8
X+ This variable specifies the number of pixels of padding to be placed 
X+ above window titles.  This allows for using small fonts with larger buttons.
X  .IP "\fBTitleForeground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8
X  This variable specifies the foreground color used in titlebars, and
X  may only be specified inside of a 
Xdiff -c old/twm.c new/twm.c
X*** old/twm.c	Thu Nov 15 20:13:18 1990
X--- new/twm.c	Tue Apr 23 08:17:17 1991
X***************
X*** 33,38 ****
X--- 33,53 ----
X   * twm - "Tom's Window Manager"
X   *
X   * $Log:	twm.c,v $
X+  * Revision 9.0  91/04/23  07:40:51  toml
X+  * Revision bump
X+  * 
X+  * Revision 8.4  90/12/29  16:39:43  toml
X+  * RJC patches
X+  * 
X+  * Revision 8.3  90/12/29  11:24:30  toml
X+  * Added PannerOpaqueScroll
X+  * 
X+  * Revision 8.2  90/12/29  10:13:16  toml
X+  * StayUpMenus
X+  * 
X+  * Revision 8.1  90/11/16  14:16:35  toml
X+  * Removed xsync
X+  * 
X   * Revision 8.0  90/11/15  20:02:53  toml
X   * Revision bump
X   * 
X***************
X*** 79,84 ****
X--- 94,101 ----
X  #include <X11/Xproto.h>
X  #include <X11/bitmaps/root_weave>
X  #include "vdt.h"
X+ #define XK_LATIN1
X+ #include <X11/keysymdef.h>
X  
X  Display *dpy;			/* which display are we talking to */
X  Window ResizeWindow;		/* the window we are resizing */
X***************
X*** 221,227 ****
X  	exit (1);
X      }
X  
X!     XSynchronize(dpy, True); /* */
X  
X      if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) {
X  	fprintf (stderr, 
X--- 238,246 ----
X  	exit (1);
X      }
X  
X! #ifdef XSYNC
X!     XSynchronize(dpy, True);
X! #endif
X  
X      if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) {
X  	fprintf (stderr, 
X***************
X*** 421,426 ****
X--- 440,447 ----
X  	Scr->siconifyPm = None;
X  	Scr->pullPm = None;
X  	Scr->hilitePm = None;
X+ 	Scr->hiliteLeftPm = None;
X+ 	Scr->hiliteRightPm = None;
X  	Scr->tbpm.xlogo = None;
X  	Scr->tbpm.resize = None;
X  	Scr->tbpm.question = None;
X***************
X*** 440,449 ****
X  	CreateGCs();
X  	MakeMenus();
X  
X! 	Scr->TitleBarFont.y += Scr->FramePadding;
X! 	Scr->TitleHeight = Scr->TitleBarFont.height + Scr->FramePadding * 2;
X  	/* make title height be odd so buttons look nice and centered */
X  	if (!(Scr->TitleHeight & 1)) Scr->TitleHeight++;
X  
X  	InitTitlebarButtons ();		/* menus are now loaded! */
X  
X--- 461,473 ----
X  	CreateGCs();
X  	MakeMenus();
X  
X! 	Scr->TitleBarFont.y += Scr->FramePadding + Scr->TitleFontPadding / 2 ;
X! 	Scr->TitleHeight = Scr->TitleBarFont.height + Scr->FramePadding * 2 + Scr->TitleFontPadding ;
X  	/* make title height be odd so buttons look nice and centered */
X+ 
X+ 	/*
X  	if (!(Scr->TitleHeight & 1)) Scr->TitleHeight++;
X+ 	*/
X  
X  	InitTitlebarButtons ();		/* menus are now loaded! */
X  
X***************
X*** 640,647 ****
X--- 664,673 ----
X      Scr->VirtualC.back = UNKNOWN_PIXEL;
X      Scr->VirtualC.fore = UNKNOWN_PIXEL;
X  
X+     Scr->MenuLineWidth = 1;
X      Scr->FramePadding = 2;		/* values that look "nice" on */
X      Scr->TitlePadding = 8;		/* 75 and 100dpi displays */
X+     Scr->TitleFontPadding = 0;
X      Scr->ButtonIndent = 1;
X      Scr->SizeStringOffset = 0;
X      Scr->BorderWidth = BW;
X***************
X*** 691,696 ****
X--- 717,724 ----
X      Scr->WarpUnmapped = FALSE;
X      Scr->NoIconTitle = FALSE;
X      Scr->StickyAbove = FALSE;
X+     Scr->StayUpMenus = FALSE;
X+     Scr->PannerOpaqueScroll = FALSE;
X  
X      /* setup default fonts; overridden by defaults from system.twmrc */
X  #define DEFAULT_NICE_FONT "variable"
X***************
X*** 701,706 ****
X--- 729,736 ----
X      Scr->TitleBarFont.name = DEFAULT_NICE_FONT;
X      Scr->MenuFont.font = NULL;
X      Scr->MenuFont.name = DEFAULT_NICE_FONT;
X+     Scr->MenuTitleFont.font = NULL;
X+     Scr->MenuTitleFont.name = NULL; /* use MenuFont unless set */
X      Scr->IconFont.font = NULL;
X      Scr->IconFont.name = DEFAULT_NICE_FONT;
X      Scr->SizeFont.font = NULL;
X***************
X*** 719,724 ****
X--- 749,758 ----
X  {
X      GetFont(&Scr->TitleBarFont);
X      GetFont(&Scr->MenuFont);
X+     if ( Scr->MenuTitleFont.name != NULL )
X+ 	{
X+ 	GetFont(&Scr->MenuTitleFont);
X+ 	}
X      GetFont(&Scr->IconFont);
X      GetFont(&Scr->SizeFont);
X      GetFont(&Scr->IconManagerFont);
X***************
X*** 919,922 ****
X--- 953,988 ----
X      _XA_WM_SAVE_YOURSELF = XInternAtom (dpy, "WM_SAVE_YOURSELF", False);
X      _XA_WM_DELETE_WINDOW = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
X      _XA_TWM_FLAGS = XInternAtom (dpy, "_TWM_FLAGS", False);
X+ }
X+ 
X+ int FIXED_XmuCompareISOLatin1 (first, second)
X+     char *first, *second;
X+ {
X+     register unsigned char *ap, *bp;
X+     register unsigned char a= *first, b= *second;
X+ 
X+     for (ap = (unsigned char *) first, bp = (unsigned char *) second;
X+ 	 *ap && *bp; ap++, bp++) {
X+ 
X+ 	if ((a = *ap) != (b = *bp)) {
X+ 	    /* try lowercasing and try again */
X+ 
X+ 	    if ((a >= XK_A) && (a <= XK_Z))
X+ 	      a += (XK_a - XK_A);
X+ 	    else if ((a >= XK_Agrave) && (a <= XK_Odiaeresis))
X+ 	      a += (XK_agrave - XK_Agrave);
X+ 	    else if ((a >= XK_Ooblique) && (a <= XK_Thorn))
X+ 	      a += (XK_oslash - XK_Ooblique);
X+ 
X+ 	    if ((b >= XK_A) && (b <= XK_Z))
X+ 	      b += (XK_a - XK_A);
X+ 	    else if ((b >= XK_Agrave) && (b <= XK_Odiaeresis))
X+ 	      b += (XK_agrave - XK_Agrave);
X+ 	    else if ((b >= XK_Ooblique) && (b <= XK_Thorn))
X+ 	      b += (XK_oslash - XK_Ooblique);
X+ 
X+ 	    if (a != b) break;
X+ 	}
X+     }
X+     return (((int)a) - ((int) b));
X  }
Xdiff -c old/util.c new/util.c
X*** old/util.c	Thu Nov 15 20:13:18 1990
X--- new/util.c	Tue Apr 23 08:17:17 1991
X***************
X*** 77,82 ****
X--- 77,83 ----
X      Window root;
X      int x, y, width, height, bw, th;
X  {
X+     static Window lastRoot;
X      static int	lastx = 0;
X      static int	lasty = 0;
X      static int	lastWidth = 0;
X***************
X*** 92,97 ****
X--- 93,101 ----
X  	&& lastBW == bw && th == lastTH)
X  	return;
X      
X+     if (root == None)
X+ 	root = lastRoot;
X+     lastRoot = root;
X      r = outline;
X  
X  #define DRAWIT() \
X***************
X*** 313,318 ****
X--- 317,324 ----
X   ***********************************************************************
X   */
X  
X+ extern int FIXED_XmuCompareISOLatin1();
X+ 
X  Pixmap FindBitmap (name, widthp, heightp)
X      char *name;
X      unsigned int *widthp, *heightp;
X***************
X*** 341,347 ****
X  	};
X  	
X  	for (i = 0; i < (sizeof pmtab)/(sizeof pmtab[0]); i++) {
X! 	    if (XmuCompareISOLatin1 (pmtab[i].name, name) == 0)
X  	      return (*pmtab[i].proc) (widthp, heightp);
X  	}
X  	fprintf (stderr, "%s:  no such built-in bitmap \"%s\"\n",
X--- 347,353 ----
X  	};
X  	
X  	for (i = 0; i < (sizeof pmtab)/(sizeof pmtab[0]); i++) {
X! 	    if (FIXED_XmuCompareISOLatin1 (pmtab[i].name, name) == 0)
X  	      return (*pmtab[i].proc) (widthp, heightp);
X  	}
X  	fprintf (stderr, "%s:  no such built-in bitmap \"%s\"\n",
Xdiff -c old/vdt.c new/vdt.c
X*** old/vdt.c	Thu Nov 15 20:13:19 1990
X--- new/vdt.c	Tue Apr 23 08:17:17 1991
X***************
X*** 28,33 ****
X--- 28,51 ----
X   * $XConsortium: vdt.c,v 1.140 90/03/23 11:42:33 jim Exp $
X   *
X   * $Log:	vdt.c,v $
X+  * Revision 9.0  91/04/23  07:40:54  toml
X+  * Revision bump
X+  * 
X+  * Revision 8.5  91/04/18  08:19:20  toml
X+  * Disable backing store on the virtual desktop
X+  * 
X+  * Revision 8.4  91/04/15  14:54:18  toml
X+  * Fixes panner interaction under OpenWindows
X+  * 
X+  * Revision 8.3  90/12/29  15:26:03  toml
X+  * Made PannerOpaqueScroll only take effect if StickyAbove is also set.
X+  * 
X+  * Revision 8.2  90/12/29  11:24:22  toml
X+  * Added PannerOpaqueScroll
X+  * 
X+  * Revision 8.1  90/12/29  09:56:37  toml
X+  * Disallow unmapnotify is window is panner
X+  * 
X   * Revision 8.0  90/11/15  20:02:56  toml
X   * Revision bump
X   * 
X***************
X*** 213,219 ****
X      if (height > MAX_VDT_HEIGHT) height = MAX_VDT_HEIGHT;
X      virtual = XCreateSimpleWindow(dpy, Scr->Panner, x, y,
X  	width, height, 1, border, background);
X!     XGrabButton(dpy, Button2, AnyModifier, virtual,
X  	True, ButtonPressMask | ButtonReleaseMask,
X  	GrabModeAsync, GrabModeAsync, Scr->Panner, None);
X      XSelectInput(dpy, virtual, KeyPressMask | ExposureMask );
X--- 231,237 ----
X      if (height > MAX_VDT_HEIGHT) height = MAX_VDT_HEIGHT;
X      virtual = XCreateSimpleWindow(dpy, Scr->Panner, x, y,
X  	width, height, 1, border, background);
X!     XGrabButton(dpy, Button2, 0L, virtual,
X  	True, ButtonPressMask | ButtonReleaseMask,
X  	GrabModeAsync, GrabModeAsync, Scr->Panner, None);
X      XSelectInput(dpy, virtual, KeyPressMask | ExposureMask );
X***************
X*** 286,292 ****
X  TwmWindow *tmp_win;
X  {
X      XUnmapWindow(dpy, tmp_win->frame);
X!     if (!tmp_win->iconmgr)
X  	XUnmapWindow(dpy, tmp_win->w);
X      if (tmp_win->virtualWindow && !tmp_win->sticky)
X  	XUnmapWindow(dpy, tmp_win->virtualWindow);
X--- 304,310 ----
X  TwmWindow *tmp_win;
X  {
X      XUnmapWindow(dpy, tmp_win->frame);
X!     if (!tmp_win->iconmgr && tmp_win->w != Scr->Panner)
X  	XUnmapWindow(dpy, tmp_win->w);
X      if (tmp_win->virtualWindow && !tmp_win->sticky)
X  	XUnmapWindow(dpy, tmp_win->virtualWindow);
X***************
X*** 499,507 ****
X  	    XFreeGC(dpy, gc);
X  	}
X      }
X!     attrMask = CWOverrideRedirect | CWEventMask | CWBackPixmap;
X      attr.override_redirect = True;
X      attr.event_mask = SubstructureRedirectMask|SubstructureNotifyMask;
X      attr.background_pixmap = Scr->rootWeave;
X      if (pm)
X  	attr.background_pixmap = pm;
X--- 517,526 ----
X  	    XFreeGC(dpy, gc);
X  	}
X      }
X!     attrMask = CWOverrideRedirect | CWEventMask | CWBackPixmap | CWBackingStore;
X      attr.override_redirect = True;
X      attr.event_mask = SubstructureRedirectMask|SubstructureNotifyMask;
X+     attr.backing_store = NotUseful;
X      attr.background_pixmap = Scr->rootWeave;
X      if (pm)
X  	attr.background_pixmap = pm;
X***************
X*** 611,620 ****
X      Scr->PannerWidth = sizeHints->base_width;
X      Scr->PannerHeight = sizeHints->base_height;
X  
X!     XGrabButton(dpy, Button1, AnyModifier, Scr->Panner,
X  	True, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
X  	GrabModeAsync, GrabModeAsync, Scr->Panner, None);
X!     XGrabButton(dpy, Button3, AnyModifier, Scr->Panner,
X  	True, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
X  	GrabModeAsync, GrabModeAsync, Scr->Panner, None);
X      XSetWMProperties(dpy, Scr->Panner, &wName, &iName, NULL, 0,
X--- 630,639 ----
X      Scr->PannerWidth = sizeHints->base_width;
X      Scr->PannerHeight = sizeHints->base_height;
X  
X!     XGrabButton(dpy, Button1, 0L, Scr->Panner,
X  	True, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
X  	GrabModeAsync, GrabModeAsync, Scr->Panner, None);
X!     XGrabButton(dpy, Button3, 0L, Scr->Panner,
X  	True, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
X  	GrabModeAsync, GrabModeAsync, Scr->Panner, None);
X      XSetWMProperties(dpy, Scr->Panner, &wName, &iName, NULL, 0,
X***************
X*** 689,694 ****
X--- 708,714 ----
X  HandlePannerMotionNotify(ev)
X  XEvent *ev;
X  {
X+     XEvent dummyev;
X      int deltaX, deltaY;
X      int newOutlineX, newOutlineY;
X  
X***************
X*** 722,727 ****
X--- 742,751 ----
X      XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
X  	Scr->PannerOutlineX, Scr->PannerOutlineY,
X  	Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X+     while(XCheckTypedEvent(dpy,MotionNotify,&dummyev));
X+     if (Scr->PannerOpaqueScroll && Scr->StickyAbove)
X+       MoveDesktop(Scr->PannerOutlineX*Scr->PannerScale,
X+ 		  Scr->PannerOutlineY*Scr->PannerScale);
X  }
X  
X  
Xdiff -c old/version.c new/version.c
X*** old/version.c	Thu Nov 15 20:13:20 1990
X--- new/version.c	Tue Apr 23 08:17:18 1991
X***************
X*** 26,30 ****
X  /*****************************************************************************/
X  
X  /* char *Version = "MIT X Consortium, R4"; */
X! char *Version = "$Revision: 8.0 $";
X  
X--- 26,30 ----
X  /*****************************************************************************/
X  
X  /* char *Version = "MIT X Consortium, R4"; */
X! char *Version = "$Revision: 9.0 $";
X  
SHAR_EOF
if test 65048 -ne "`wc -c < patch.5`"
then
    echo shar: error transmitting "patch.5" '(should have been 65048 characters)'
fi
fi
# end of shell archive
exit 0

--
Dan Heller
O'Reilly && Associates       Z-Code Software    Comp-sources-x:
Senior Writer                President          comp-sources.x at uunet.uu.net
argv at ora.com                 argv at zipcode.com



More information about the Comp.sources.x mailing list