[comp.sources.x] v09i020: tvtwm, Patch2, Part01/01

toml@Solbourne.COM (09/07/90)

Submitted-by: toml@Solbourne.COM
Posting-number: Volume 9, Issue 20
Archive-name: tvtwm/patch2
Patch-To: tvtwm: Volume 9, Issues 2-11

#! /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.2
#
# Created by toml () on Wed Sep  5 00:22:13 MDT 1990
#
if test -f 'patch.2'
then
    echo shar: will not over-write existing file "patch.2"
else
echo extracting "patch.2"
sed 's/^X//' >patch.2 <<'SHAR_EOF'
Xtvtwm patch 2
X
XThis patch fixes the following problems:
X
X 1.  Not passing addresses of structs in call to XSetWMProperties.
X 2.  Resizing windows doesn't work properly in other quadrants
X     of the Virtual Desktop.
X 3.  Stray outlines could be left during panning operations.
X 4.  Expose events flushed when painting the panner.
X 5.  Various gcc complaints fixed.
X 6.  f.zoom functions noew work in other quadrants of desktop.
X 7.  Less than full screenfuls panned via ScrollDistanceX and ScrollDistanceY.
X 8.  DontMoveOff now works.
X 9.  Panner out of sync following f.circle commands.
X 10. Unsticking a normally sticky window wasn't remembered on restart.
X 11. New command called f.scroll "position".
X
X----------------------
Xdiff -c ./README.tvtwm ../new/README.tvtwm
X*** ./README.tvtwm	Thu Aug 30 07:17:58 1990
X--- ../new/README.tvtwm	Tue Sep  4 23:56:43 1990
X***************
X*** 73,80 ****
X     The new window move code is in a new file called move.c.
X  
X  3. Opaque moves look kind of strange when dragging windows in
X!    and out of the panner, but they do the right thing.  DontMoveOff
X!    has not been fixed to work properly with the desktop.
X  
X  4. Rather than the f.nail and "NailedDown" features of vtwm, tvtwm
X     uses the same terminology as swm.  In tvtwm, windows that do
X--- 73,79 ----
X     The new window move code is in a new file called move.c.
X  
X  3. Opaque moves look kind of strange when dragging windows in
X!    and out of the panner, but they do the right thing.
X  
X  4. Rather than the f.nail and "NailedDown" features of vtwm, tvtwm
X     uses the same terminology as swm.  In tvtwm, windows that do
X***************
X*** 148,169 ****
X  PannerForeground "color"
X    This color is only used if PannerBackgroundPixmap is set.
X  
X  Sticky { window list }
X    A list of windows that will come up in a sticky state.
X  
X  New Commands:
X  
X! f.panner	- toggle making the panner visible
X! f.scrollhome	- scroll the desktop to 0,0
X! f.scrollup	- scroll the desktop up one screenful
X! f.scrolldown	- scroll the desktop down one screenful
X! f.scrollleft	- scroll the desktop left on screenful
X! f.scrollright	- scroll the desktop right on screenful
X! f.panup		- same as f.scrollup
X! f.pandown	- same as f.scrolldown
X! f.panleft	- same as f.scrollleft
X! f.panright	- same as f.scrollright
X! f.stick		- toggle making a window sticky or not
X  
X  
X  A version of xsetroot, called ssetroot has been included as an
X--- 147,174 ----
X  PannerForeground "color"
X    This color is only used if PannerBackgroundPixmap is set.
X  
X+ ScrollDistanceX	percentage
X+ ScrollDistanceY percentage
X+   The percentage of the display width/height to move for the f.scroll
X+   commands
X+ 
X  Sticky { window list }
X    A list of windows that will come up in a sticky state.
X  
X  New Commands:
X  
X! f.panner		- toggle making the panner visible
X! f.scroll "position"	- scroll to a specific position
X! f.scrollhome		- scroll the desktop to 0,0
X! f.scrollup		- scroll the desktop up ScrollDistanceY
X! f.scrolldown		- scroll the desktop down ScrollDistanceY
X! f.scrollleft		- scroll the desktop left ScrollDistanceX
X! f.scrollright		- scroll the desktop right ScrollDistanceX
X! f.panup			- same as f.scrollup
X! f.pandown		- same as f.scrolldown
X! f.panleft		- same as f.scrollleft
X! f.panright		- same as f.scrollright
X! f.stick			- toggle making a window sticky or not
X  
X  
X  A version of xsetroot, called ssetroot has been included as an
Xdiff -c ./add_window.c ../new/add_window.c
X*** ./add_window.c	Thu Aug 30 07:17:58 1990
X--- ../new/add_window.c	Tue Sep  4 23:56:43 1990
X***************
X*** 239,247 ****
X  	if (tmp_win->w == Scr->Panner)
X  	    tmp_win->sticky = True;
X  
X! 	if (RestartPreviousState) {
X  	    if (tmp_win->flags & TWM_FLAGS_STICKY)
X  		tmp_win->sticky = True;
X  	}
X      }
X  
X--- 239,249 ----
X  	if (tmp_win->w == Scr->Panner)
X  	    tmp_win->sticky = True;
X  
X! 	if (tmp_win->flags & TWM_FLAGS_VALID) {
X  	    if (tmp_win->flags & TWM_FLAGS_STICKY)
X  		tmp_win->sticky = True;
X+ 	    else
X+ 		tmp_win->sticky = False;
X  	}
X      }
X  
X***************
X*** 681,687 ****
X--- 683,698 ----
X  		if (Scr->AutoRelativeResize) {
X  		    int dx = (tmp_win->attr.width / 4);
X  		    int dy = (tmp_win->attr.height / 4);
X+ 		    int offsetx, offsety;
X  		    
X+ 		    if (tmp_win->root == Scr->VirtualDesktop) {
X+ 			offsetx = Scr->vdtPositionX;
X+ 			offsety = Scr->vdtPositionY;
X+ 		    }
X+ 		    else {
X+ 			offsetx = 0;
X+ 			offsety = 0;
X+ 		    }
X  #define HALF_AVE_CURSOR_SIZE 8		/* so that it is visible */
X  		    if (dx < HALF_AVE_CURSOR_SIZE) dx = HALF_AVE_CURSOR_SIZE;
X  		    if (dy < HALF_AVE_CURSOR_SIZE) dy = HALF_AVE_CURSOR_SIZE;
X***************
X*** 688,701 ****
X  #undef HALF_AVE_CURSOR_SIZE
X  		    dx += (tmp_win->frame_bw + 1);
X  		    dy += (bw2 + tmp_win->title_height + 1);
X! 		    if (AddingX + dx >= Scr->MyDisplayWidth)
X! 		      dx = Scr->MyDisplayWidth - AddingX - 1;
X! 		    if (AddingY + dy >= Scr->MyDisplayHeight)
X! 		      dy = Scr->MyDisplayHeight - AddingY - 1;
X  		    if (dx > 0 && dy > 0)
X  		      XWarpPointer (dpy, None, None, 0, 0, 0, 0, dx, dy);
X  		} else {
X! 		    XWarpPointer (dpy, None, Scr->Root, 0, 0, 0, 0,
X  				  AddingX + AddingW/2, AddingY + AddingH/2);
X  		}
X  		AddStartResize(tmp_win, AddingX, AddingY, AddingW, AddingH);
X--- 699,712 ----
X  #undef HALF_AVE_CURSOR_SIZE
X  		    dx += (tmp_win->frame_bw + 1);
X  		    dy += (bw2 + tmp_win->title_height + 1);
X! 		    if (AddingX + dx >= (Scr->MyDisplayWidth + offsetx))
X! 		      dx = Scr->MyDisplayWidth - AddingX - 1 + offsetx;
X! 		    if (AddingY + dy >= (Scr->MyDisplayHeight + offsety))
X! 		      dy = Scr->MyDisplayHeight - AddingY - 1 + offsety;
X  		    if (dx > 0 && dy > 0)
X  		      XWarpPointer (dpy, None, None, 0, 0, 0, 0, dx, dy);
X  		} else {
X! 		    XWarpPointer (dpy, None, tmp_win->root, 0, 0, 0, 0,
X  				  AddingX + AddingW/2, AddingY + AddingH/2);
X  		}
X  		AddStartResize(tmp_win, AddingX, AddingY, AddingW, AddingH);
X***************
X*** 725,731 ****
X--- 736,744 ----
X  			AddEndResize(tmp_win);
X  			break;
X  		    }
X+ 	    
X  		}
X+ 		MoveOutline(tmp_win->root, 0, 0, 0, 0, 0, 0);
X  	    } 
X  	    else if (cancel == Button3)
X  	    {
X***************
X*** 732,737 ****
X--- 745,755 ----
X  		int maxw = Scr->MyDisplayWidth - AddingX - bw2;
X  		int maxh = Scr->MyDisplayHeight - AddingY - bw2;
X  
X+ 		if (tmp_win->root == Scr->VirtualDesktop) {
X+ 		    maxw += Scr->vdtPositionX;
X+ 		    maxh += Scr->vdtPositionY;
X+ 		}
X+ 
X  		/*
X  		 * Make window go to bottom of screen, and clip to right edge.
X  		 * This is useful when popping up large windows and fixed
X***************
X*** 749,755 ****
X  		XMaskEvent(dpy, ButtonReleaseMask, &event);
X  	    }
X  
X- 	    MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
X  	    XUnmapWindow(dpy, Scr->SizeWindow);
X  	    UninstallRootColormap();
X  	    XUngrabPointer(dpy, CurrentTime);
X--- 767,772 ----
X***************
X*** 777,785 ****
X       * being used.  In our case, if PPosition is set, we will translate
X       * the coordinates of the window into virtual desktop coordinates
X       */
X!     if (tmp_win->root == Scr->VirtualDesktop &&
X! 	(!FromVirtualDesktop && tmp_win->transient) ||
X!     	(ask_user == FALSE && (tmp_win->hints.flags & PPosition)))
X      {
X  	tmp_win->frame_x += Scr->vdtPositionX;
X  	tmp_win->frame_y += Scr->vdtPositionY;
X--- 794,802 ----
X       * being used.  In our case, if PPosition is set, we will translate
X       * the coordinates of the window into virtual desktop coordinates
X       */
X!      if ((tmp_win->root == Scr->VirtualDesktop) && 
X!          ((!FromVirtualDesktop && tmp_win->transient) || 
X!           (ask_user == FALSE && (tmp_win->hints.flags & PPosition))))
X      {
X  	tmp_win->frame_x += Scr->vdtPositionX;
X  	tmp_win->frame_y += Scr->vdtPositionY;
X***************
X*** 1530,1535 ****
X--- 1547,1554 ----
X  	*flags = 0;
X  	return;
X      }
X+     /* OR in the valid bit */
X+     *datap |= TWM_FLAGS_VALID;
X      *flags = *datap;
X      XFree ((char *) datap);
X      return;
Xdiff -c ./events.c ../new/events.c
X*** ./events.c	Thu Aug 30 07:17:59 1990
X--- ../new/events.c	Tue Sep  4 23:56:44 1990
X***************
X*** 1278,1286 ****
X      {
X  	/* Add decorations. */
X  	if (parent == Scr->VirtualDesktop)
X! 	    FromVirtualDesktop == True;
X  	Tmp_win = AddWindow(Event.xany.window, FALSE, (IconMgr *) NULL);
X! 	FromVirtualDesktop == False;
X  	if (Tmp_win == NULL)
X  	    return;
X      }
X--- 1278,1286 ----
X      {
X  	/* Add decorations. */
X  	if (parent == Scr->VirtualDesktop)
X! 	    FromVirtualDesktop = True;
X  	Tmp_win = AddWindow(Event.xany.window, FALSE, (IconMgr *) NULL);
X! 	FromVirtualDesktop = False;
X  	if (Tmp_win == NULL)
X  	    return;
X      }
XOnly in .: lex.c
Xdiff -c ./menus.c ../new/menus.c
X*** ./menus.c	Thu Aug 30 07:18:02 1990
X--- ../new/menus.c	Tue Sep  4 23:56:46 1990
X***************
X*** 1182,1193 ****
X  	}
X  	break;
X  
X      case F_SCROLLHOME:
X      case F_SCROLLLEFT:
X      case F_SCROLLRIGHT:
X      case F_SCROLLUP:
X      case F_SCROLLDOWN:
X! 	ScrollDesktop(func);
X  	break;
X  
X      case F_DELTASTOP:
X--- 1182,1194 ----
X  	}
X  	break;
X  
X+     case F_SCROLL:
X      case F_SCROLLHOME:
X      case F_SCROLLLEFT:
X      case F_SCROLLRIGHT:
X      case F_SCROLLUP:
X      case F_SCROLLDOWN:
X! 	ScrollDesktop(func, action);
X  	break;
X  
X      case F_DELTASTOP:
X***************
X*** 1809,1823 ****
X  	break;
X  
X      case F_CIRCLEUP:
X! 	if (Scr->VirtualDesktop)
X  	    XCirculateSubwindowsUp(dpy, Scr->VirtualDesktop);
X  	else
X  	    XCirculateSubwindowsUp(dpy, Scr->Root);
X  	break;
X  
X      case F_CIRCLEDOWN:
X! 	if (Scr->VirtualDesktop)
X  	    XCirculateSubwindowsDown(dpy, Scr->VirtualDesktop);
X  	else
X  	    XCirculateSubwindowsDown(dpy, Scr->Root);
X  	break;
X--- 1810,1828 ----
X  	break;
X  
X      case F_CIRCLEUP:
X! 	if (Scr->VirtualDesktop) {
X  	    XCirculateSubwindowsUp(dpy, Scr->VirtualDesktop);
X+ 	    XCirculateSubwindowsUp(dpy, Scr->Panner);
X+ 	}
X  	else
X  	    XCirculateSubwindowsUp(dpy, Scr->Root);
X  	break;
X  
X      case F_CIRCLEDOWN:
X! 	if (Scr->VirtualDesktop) {
X  	    XCirculateSubwindowsDown(dpy, Scr->VirtualDesktop);
X+ 	    XCirculateSubwindowsDown(dpy, Scr->Panner);
X+ 	}
X  	else
X  	    XCirculateSubwindowsDown(dpy, Scr->Root);
X  	break;
Xdiff -c ./move.c ../new/move.c
X*** ./move.c	Thu Aug 30 07:18:02 1990
X--- ../new/move.c	Tue Sep  4 23:56:46 1990
X***************
X*** 99,104 ****
X--- 99,106 ----
X      if (!cancel && WindowMoved) {
X  	SetupWindow (tmp_win, x_root, y_root,
X  	     tmp_win->frame_width, tmp_win->frame_height, -1);
X+ 	if (!Scr->NoRaiseMove)
X+ 	    RaiseFrame(tmp_win);
X      }
X  }
X  
X***************
X*** 129,134 ****
X--- 131,138 ----
X  
X      if (!cancel && WindowMoved) {
X  	MoveIcon(tmp_win, x_root, y_root);
X+ 	if (!Scr->NoRaiseMove)
X+ 	    RaiseIcon(tmp_win);
X      }
X  }
X  
X***************
X*** 335,340 ****
X--- 339,345 ----
X  {
X      int xl, yt;
X      int deltax, deltay;
X+     int vdtx, vdty;
X      char str[20];
X  
X      dragX = x_root;
X***************
X*** 346,351 ****
X--- 351,374 ----
X      deltax = xl - origX/scale;
X      deltay = yt - origY/scale;
X  
X+     if (Scr->DontMoveOff && outlineWindow != Scr->Panner) {
X+ 	if (tmp_win->root == Scr->VirtualDesktop) {
X+ 	    vdtx = Scr->vdtPositionX;
X+ 	    vdty = Scr->vdtPositionY;
X+ 	}
X+ 	else {
X+ 	    vdtx = 0;
X+ 	    vdty = 0;
X+ 	}
X+ 	if (xl < vdtx)
X+ 	    xl = vdtx;
X+ 	else if ((xl + dragWidth) > (Scr->MyDisplayWidth + vdtx))
X+ 	    xl = vdtx + Scr->MyDisplayWidth - dragWidth;
X+ 	if (yt < vdty)
X+ 	    yt = vdty;
X+ 	else if ((yt + dragHeight) > (Scr->MyDisplayHeight + vdty))
X+ 	    yt = vdty + Scr->MyDisplayHeight - dragHeight;
X+     }
X  
X      if (Scr->OpaqueMove)
X  	XMoveWindow(dpy, window, xl, yt);
Xdiff -c ./parse.c ../new/parse.c
X*** ./parse.c	Thu Aug 30 07:18:02 1990
X--- ../new/parse.c	Tue Sep  4 23:56:47 1990
X***************
X*** 366,371 ****
X--- 366,373 ----
X  #define kwn_IconBorderWidth		8
X  #define kwn_TitleButtonBorderWidth	9
X  #define kwn_PannerScale			10
X+ #define kwn_ScrollDistanceX		11
X+ #define kwn_ScrollDistanceY		12
X  
X  #define kwcl_BorderColor		1
X  #define kwcl_IconManagerHighlight	2
X***************
X*** 474,479 ****
X--- 476,482 ----
X      { "f.righticonmgr",		FKEYWORD, F_RIGHTICONMGR },
X      { "f.rightzoom",		FKEYWORD, F_RIGHTZOOM },
X      { "f.saveyourself",		FKEYWORD, F_SAVEYOURSELF },
X+     { "f.scroll",		FSKEYWORD, F_SCROLL },
X      { "f.scrolldown",		FKEYWORD, F_SCROLLDOWN },
X      { "f.scrollhome",		FKEYWORD, F_SCROLLHOME },
X      { "f.scrollleft",		FKEYWORD, F_SCROLLLEFT },
X***************
X*** 576,581 ****
X--- 579,586 ----
X      { "righttitlebutton",	RIGHT_TITLEBUTTON, 0 },
X      { "root",			ROOT, 0 },
X      { "s",			SHIFT, 0 },
X+     { "scrolldistancex",	NKEYWORD, kwn_ScrollDistanceX },
X+     { "scrolldistancey",	NKEYWORD, kwn_ScrollDistanceY },
X      { "select",			SELECT, 0 },
X      { "shift",			SHIFT, 0 },
X      { "showiconmanager",	KEYWORD, kw0_ShowIconManager },
X***************
X*** 767,773 ****
X  
X        case kws_VirtualDesktop:
X  	{
X! 	    int status, width, height, x, y;
X  
X  	    status = XParseGeometry(s, &x, &y, &width, &height);
X  	    if ((status & (WidthValue & HeightValue)) != (WidthValue & HeightValue)) {
X--- 772,779 ----
X  
X        case kws_VirtualDesktop:
X  	{
X! 	    int status, x, y;
X! 	    unsigned int width, height;
X  
X  	    status = XParseGeometry(s, &x, &y, &width, &height);
X  	    if ((status & (WidthValue & HeightValue)) != (WidthValue & HeightValue)) {
X***************
X*** 797,803 ****
X  
X        case kws_PannerGeometry:
X  	{
X! 	    int status, width, height, x, y;
X  	    status = XParseGeometry(s, &x, &y, &width, &height);
X  	    if ((status & (XValue & YValue)) != (XValue & YValue)) {
X  		twmrc_error_prefix();
X--- 803,811 ----
X  
X        case kws_PannerGeometry:
X  	{
X! 	    int status, x, y;
X! 	    unsigned int width, height;
X! 
X  	    status = XParseGeometry(s, &x, &y, &width, &height);
X  	    if ((status & (XValue & YValue)) != (XValue & YValue)) {
X  		twmrc_error_prefix();
X***************
X*** 880,885 ****
X--- 888,903 ----
X        case kwn_PannerScale:
X  	if (num > 0)
X  	    Scr->PannerScale = num;
X+ 	return 1;
X+ 
X+       case kwn_ScrollDistanceX:
X+ 	if (Scr->FirstTime)
X+ 		Scr->vdtScrollDistanceX = (num * Scr->MyDisplayWidth) / 100;
X+ 	return 1;
X+ 
X+       case kwn_ScrollDistanceY:
X+ 	if (Scr->FirstTime)
X+ 		Scr->vdtScrollDistanceY = (num * Scr->MyDisplayHeight) / 100;
X  	return 1;
X  
X        case kwn_ConstrainedMoveTime:
Xdiff -c ./parse.h ../new/parse.h
X*** ./parse.h	Thu Aug 30 07:18:03 1990
X--- ../new/parse.h	Tue Sep  4 23:56:47 1990
X***************
X*** 108,113 ****
X--- 108,114 ----
X  #define F_FUNCTION		108	/* string */
X  #define F_WARPTOSCREEN		109	/* string */
X  #define F_COLORMAP		110	/* string */
X+ #define F_SCROLL		111	/* string */
X  
X  #define D_NORTH			1
X  #define D_SOUTH			2
Xdiff -c ./patchlevel.h ../new/patchlevel.h
X*** ./patchlevel.h	Thu Aug 30 07:18:03 1990
X--- ../new/patchlevel.h	Tue Sep  4 23:56:47 1990
X***************
X*** 1 ****
X! #define PATCHLEVEL 1
X--- 1 ----
X! #define PATCHLEVEL 2
Xdiff -c ./resize.c ../new/resize.c
X*** ./resize.c	Thu Aug 30 07:18:03 1990
X--- ../new/resize.c	Tue Sep  4 23:56:47 1990
X***************
X*** 72,77 ****
X--- 72,80 ----
X  static int last_width;
X  static int last_height;
X  
X+ static int offsetX;
X+ static int offsetY;
X+ static Window outlineWindow;
X  
X  static void do_auto_clamp (tmp_win, evp)
X      TwmWindow *tmp_win;
X***************
X*** 147,152 ****
X--- 150,165 ----
X          GrabModeAsync, GrabModeAsync,
X          Scr->Root, Scr->ResizeCursor, CurrentTime);
X  
X+     outlineWindow = tmp_win->root;
X+     if (tmp_win->root != Scr->Root) {
X+ 	offsetX = Scr->vdtPositionX;
X+ 	offsetY = Scr->vdtPositionY;
X+     }
X+     else {
X+ 	offsetX = 0;
X+ 	offsetY = 0;
X+     }
X+ 	
X      XGetGeometry(dpy, (Drawable) tmp_win->frame, &junkRoot,
X          &dragx, &dragy, (unsigned int *)&dragWidth, (unsigned int *)&dragHeight, &junkbw,
X                   &junkDepth);
X***************
X*** 170,176 ****
X      last_width = 0;
X      last_height = 0;
X      DisplaySize(tmp_win, origWidth, origHeight);
X!     MoveOutline (Scr->Root, dragx - tmp_win->frame_bw,
X  		 dragy - tmp_win->frame_bw, dragWidth + 2 * tmp_win->frame_bw,
X  		 dragHeight + 2 * tmp_win->frame_bw,
X  		 tmp_win->frame_bw, tmp_win->title_height);
X--- 183,189 ----
X      last_width = 0;
X      last_height = 0;
X      DisplaySize(tmp_win, origWidth, origHeight);
X!     MoveOutline (outlineWindow, dragx - tmp_win->frame_bw,
X  		 dragy - tmp_win->frame_bw, dragWidth + 2 * tmp_win->frame_bw,
X  		 dragHeight + 2 * tmp_win->frame_bw,
X  		 tmp_win->frame_bw, tmp_win->title_height);
X***************
X*** 198,203 ****
X--- 211,226 ----
X          GrabModeAsync, GrabModeAsync,
X          Scr->Root, Scr->ResizeCursor, CurrentTime);
X  
X+     outlineWindow = tmp_win->root;
X+     if (tmp_win->root != Scr->Root) {
X+ 	offsetX = Scr->vdtPositionX;
X+ 	offsetY = Scr->vdtPositionY;
X+     }
X+     else {
X+ 	offsetX = 0;
X+ 	offsetY = 0;
X+     }
X+ 	
X      dragx = x + tmp_win->frame_bw;
X      dragy = y + tmp_win->frame_bw;
X      origx = dragx;
X***************
X*** 213,218 ****
X--- 236,248 ----
X      last_width = 0;
X      last_height = 0;
X      DisplaySize(tmp_win, origWidth, origHeight);
X+ 
X+     MoveOutline(outlineWindow,
X+ 	dragx - tmp_win->frame_bw,
X+ 	dragy - tmp_win->frame_bw,
X+ 	dragWidth + 2 * tmp_win->frame_bw,
X+ 	dragHeight + 2 * tmp_win->frame_bw,
X+ 	tmp_win->frame_bw, tmp_win->title_height);
X  }
X  
X  /***********************************************************************
X***************
X*** 241,246 ****
X--- 271,278 ----
X  
X      x_root -= clampDX;
X      y_root -= clampDY;
X+     x_root += offsetX;
X+     y_root += offsetY;
X  
X      if (clampTop) {
X          int         delta = y_root - dragy;
X***************
X*** 327,333 ****
X              dragx = origx + origWidth - dragWidth;
X          if (clampTop)
X              dragy = origy + origHeight - dragHeight;
X!         MoveOutline(Scr->Root,
X              dragx - tmp_win->frame_bw,
X              dragy - tmp_win->frame_bw,
X              dragWidth + 2 * tmp_win->frame_bw,
X--- 359,365 ----
X              dragx = origx + origWidth - dragWidth;
X          if (clampTop)
X              dragy = origy + origHeight - dragHeight;
X!         MoveOutline(outlineWindow,
X              dragx - tmp_win->frame_bw,
X              dragy - tmp_win->frame_bw,
X              dragWidth + 2 * tmp_win->frame_bw,
X***************
X*** 421,427 ****
X      fprintf(stderr, "EndResize\n");
X  #endif
X  
X!     MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
X      XUnmapWindow(dpy, Scr->SizeWindow);
X  
X      XFindContext(dpy, ResizeWindow, TwmContext, (caddr_t *)&tmp_win);
X--- 453,459 ----
X      fprintf(stderr, "EndResize\n");
X  #endif
X  
X!     MoveOutline(outlineWindow, 0, 0, 0, 0, 0, 0);
X      XUnmapWindow(dpy, Scr->SizeWindow);
X  
X      XFindContext(dpy, ResizeWindow, TwmContext, (caddr_t *)&tmp_win);
X***************
X*** 830,840 ****
X--- 862,882 ----
X  {
X      Window      junkRoot;
X      unsigned int junkbw, junkDepth;
X+     int basex, basey;
X  
X      XGetGeometry(dpy, (Drawable) tmp_win->frame, &junkRoot,
X          &dragx, &dragy, (unsigned int *)&dragWidth, (unsigned int *)&dragHeight, &junkbw,
X          &junkDepth);
X  
X+ 	if (tmp_win->root = Scr->VirtualDesktop) {
X+ 	    basex = Scr->vdtPositionX;
X+ 	    basey = Scr->vdtPositionY;
X+ 	}
X+ 	else {
X+ 	    basex = 0;
X+ 	    basey = 0;
X+ 	}
X+ 
X          if (tmp_win->zoomed == flag)
X          {
X              dragHeight = tmp_win->save_frame_height;
X***************
X*** 863,901 ****
X              break;
X          case F_ZOOM:
X              dragHeight = Scr->MyDisplayHeight;
X!             dragy=0;
X              break;
X          case F_HORIZOOM:
X!             dragx = 0;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X          case F_FULLZOOM:
X!             dragx = 0;
X!             dragy = 0;
X              dragHeight = Scr->MyDisplayHeight;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X          case F_LEFTZOOM:
X!             dragx = 0;
X!             dragy = 0;
X              dragHeight = Scr->MyDisplayHeight;
X              dragWidth = Scr->MyDisplayWidth/2;
X              break;
X          case F_RIGHTZOOM:
X!             dragx = Scr->MyDisplayWidth/2;
X!             dragy = 0;
X              dragHeight = Scr->MyDisplayHeight;
X              dragWidth = Scr->MyDisplayWidth/2;
X              break;
X          case F_TOPZOOM:
X!             dragx = 0;
X!             dragy = 0;
X              dragHeight = Scr->MyDisplayHeight/2;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X          case F_BOTTOMZOOM:
X!             dragx = 0;
X!             dragy = Scr->MyDisplayHeight/2;
X              dragHeight = Scr->MyDisplayHeight/2;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X--- 905,943 ----
X              break;
X          case F_ZOOM:
X              dragHeight = Scr->MyDisplayHeight;
X!             dragy=basey;
X              break;
X          case F_HORIZOOM:
X!             dragx = basex;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X          case F_FULLZOOM:
X!             dragx = basex;
X!             dragy = basey;
X              dragHeight = Scr->MyDisplayHeight;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X          case F_LEFTZOOM:
X!             dragx = basex;
X!             dragy = basey;
X              dragHeight = Scr->MyDisplayHeight;
X              dragWidth = Scr->MyDisplayWidth/2;
X              break;
X          case F_RIGHTZOOM:
X!             dragx = basex + Scr->MyDisplayWidth/2;
X!             dragy = basey;
X              dragHeight = Scr->MyDisplayHeight;
X              dragWidth = Scr->MyDisplayWidth/2;
X              break;
X          case F_TOPZOOM:
X!             dragx = basex;
X!             dragy = basey;
X              dragHeight = Scr->MyDisplayHeight/2;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
X          case F_BOTTOMZOOM:
X!             dragx = basex;
X!             dragy = basey + Scr->MyDisplayHeight/2;
X              dragHeight = Scr->MyDisplayHeight/2;
X              dragWidth = Scr->MyDisplayWidth;
X              break;
Xdiff -c ./screen.h ../new/screen.h
X*** ./screen.h	Thu Aug 30 07:18:03 1990
X--- ../new/screen.h	Tue Sep  4 23:56:47 1990
X***************
X*** 78,83 ****
X--- 78,85 ----
X      int vdtHeight;		/* height of the virtual desktop */
X      int vdtPositionX;		/* where the virtual desktop is currently positioned */
X      int vdtPositionY;		/* where the virtual desktop is currently positioned */
X+     int vdtScrollDistanceX;	/* fraction to pan by in the X direction */
X+     int vdtScrollDistanceY;	/* fraction to pan by in the Y direction */
X  
X      name_list *Icons;		/* list of icon pixmaps */
X      TitlebarPixmaps tbpm;	/* titlebar pixmaps */
Xdiff -c ./tvtwm.man ../new/tvtwm.man
X*** ./tvtwm.man	Thu Aug 30 07:18:04 1990
X--- ../new/tvtwm.man	Tue Sep  4 23:56:48 1990
X***************
X*** 733,738 ****
X--- 733,746 ----
X  to tell which windows should be iconified and which should be left visible.
X  This is typically used to make try to regenerate the state that the screen
X  was in before the previous window manager was shutdown.
X+ .IP "\fBScrollDistanceX\fP \fIpercentage\fP" 8
X+ This variable specifies the amount (as a percentage of the screen width)
X+ to move when one of the scroll functions \fBf.scrollleft\fP
X+ or \fBf.scrollright\fP is called.
X+ .IP "\fBScrollDistanceY\fP \fIpercentage\fP" 8
X+ This variable specifies the amount (as a percentage of the screen height)
X+ to move when one of the scroll functions \fBf.scrollup\fP
X+ or \fBf.scrolldown\fP is called.
X  .IP "\fBShowIconManager\fP" 8
X  This variable indicates that the icon manager window should be displayed when
X  \fItwm\fP is started.  It can always be brought up using the
X***************
X*** 1136,1151 ****
X  window and update the WM_COMMAND property as specified in the ICCCM.  If
X  the selected window has not selected for this message, the keyboard bell
X  will be rung.
X  .IP "\fBf.scrolldown\fP" 8
X! This function scrolls the Virtual Desktop down one screenful.
X  .IP "\fBf.scrollhome\fP" 8
X  This function scrolls the Virtual Desktop to the home location.
X  .IP "\fBf.scrollleft\fP" 8
X! This function scrolls the Virtual Desktop left one screenful.
X  .IP "\fBf.scrollright\fP" 8
X! This function scrolls the Virtual Desktop right one screenful.
X  .IP "\fBf.scrollup\fP" 8
X! This function scrolls the Virtual Desktop up one screenful.
X  .IP "\fBf.showiconmgr\fP" 8
X  This function maps the current icon manager.
X  .IP "\fBf.sorticonmgr\fP" 8
X--- 1144,1169 ----
X  window and update the WM_COMMAND property as specified in the ICCCM.  If
X  the selected window has not selected for this message, the keyboard bell
X  will be rung.
X+ .IP "\fBf.scrolldown\fP \fIstring\fP" 8
X+ This function scrolls the Virtual Desktop to a specific logical screen
X+ quadrant.  The \fIstring\fP parameter is a geometry specification
X+ indicating how to scroll the desktop.  For example, "+0+0" would scroll
X+ the desktop to the home location and "+2+1" would scroll the desktop
X+ to the quadrant in the third logical column and the second row.
X  .IP "\fBf.scrolldown\fP" 8
X! This function scrolls the Virtual Desktop down a fraction of the height of
X! the screen specified in ScrollDistanceY.
X  .IP "\fBf.scrollhome\fP" 8
X  This function scrolls the Virtual Desktop to the home location.
X  .IP "\fBf.scrollleft\fP" 8
X! This function scrolls the Virtual Desktop left a fraction of the width of
X! the screen specified in ScrollDistanceX.
X  .IP "\fBf.scrollright\fP" 8
X! This function scrolls the Virtual Desktop right a fraction of the width of
X! the screen specified in ScrollDistanceX.
X  .IP "\fBf.scrollup\fP" 8
X! This function scrolls the Virtual Desktop up one a fraction of the height of
X! the screen specified in ScrollDistanceY.
X  .IP "\fBf.showiconmgr\fP" 8
X  This function maps the current icon manager.
X  .IP "\fBf.sorticonmgr\fP" 8
Xdiff -c ./twm.c ../new/twm.c
X*** ./twm.c	Thu Aug 30 07:18:04 1990
X--- ../new/twm.c	Tue Sep  4 23:56:48 1990
X***************
X*** 346,351 ****
X--- 346,354 ----
X  	Scr->MaxWindowWidth = 32767 - Scr->MyDisplayWidth;
X  	Scr->MaxWindowHeight = 32767 - Scr->MyDisplayHeight;
X  
X+ 	Scr->vdtScrollDistanceX = Scr->MyDisplayWidth;
X+ 	Scr->vdtScrollDistanceY = Scr->MyDisplayHeight;
X+ 
X  	Scr->XORvalue = (((unsigned long) 1) << Scr->d_depth) - 1;
X  
X  	if (DisplayCells(dpy, scrnum) < 3)
X***************
X*** 774,781 ****
X  	InstallWindowColormaps (0, &Scr->TwmRoot);	/* force reinstall */
X  	for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next)
X  	{
X- 	    RestoreWithdrawnLocation (tmp);
X  	    XDeleteProperty(dpy, tmp->w, XA_SWM_ROOT);
X  	    XMapWindow (dpy, tmp->w);
X  	}
X  
X--- 777,784 ----
X  	InstallWindowColormaps (0, &Scr->TwmRoot);	/* force reinstall */
X  	for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next)
X  	{
X  	    XDeleteProperty(dpy, tmp->w, XA_SWM_ROOT);
X+ 	    RestoreWithdrawnLocation (tmp);
X  	    XMapWindow (dpy, tmp->w);
X  	}
X  
Xdiff -c ./twm.h ../new/twm.h
X*** ./twm.h	Thu Aug 30 07:18:05 1990
X--- ../new/twm.h	Tue Sep  4 23:56:48 1990
X***************
X*** 51,56 ****
X--- 51,57 ----
X  #endif
X  
X  typedef unsigned long Pixel;
X+ #define PIXEL_ALREADY_TYPEDEFED
X  
X  #ifdef SIGNALRETURNSINT
X  typedef int (*SigProc)();	/* type of function returned by signal() */
X***************
X*** 197,203 ****
X   * will be used to store state information to be used if 
X   * RestartPreviousState is set
X   */
X! #define TWM_FLAGS_STICKY	(1 << 0)
X  
X  /* for each window that is on the display, one of these structures
X   * is allocated and linked into a list 
X--- 198,205 ----
X   * will be used to store state information to be used if 
X   * RestartPreviousState is set
X   */
X! #define TWM_FLAGS_VALID		(1 << 0)	/* the flags property was present */
X! #define TWM_FLAGS_STICKY	(1 << 1)	/* the sticky state */
X  
X  /* for each window that is on the display, one of these structures
X   * is allocated and linked into a list 
Xdiff -c ./vdt.c ../new/vdt.c
X*** ./vdt.c	Thu Aug 30 07:18:05 1990
X--- ../new/vdt.c	Tue Sep  4 23:56:49 1990
X***************
X*** 583,589 ****
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  	sizeHints, wmHints, classHints);
X  
X      if (Scr->PannerState != WithdrawnState)
X--- 583,589 ----
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  	sizeHints, wmHints, classHints);
X  
X      if (Scr->PannerState != WithdrawnState)
X***************
X*** 595,600 ****
X--- 595,602 ----
X  HandlePannerExpose(ev)
X  XEvent *ev;
X  {
X+     XEvent dummy;
X+ 
X      if (ev->xexpose.count)
X  	return;
X  
X***************
X*** 606,625 ****
X      XDrawRectangle(dpy, Scr->Panner, Scr->PannerGC,
X  	Scr->PannerOutlineX, Scr->PannerOutlineY,
X  	Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X  }
X  
X  void
X  HandlePannerButtonPress(ev)
X  XEvent *ev;
X  {
X!     pointerX = Scr->PannerOutlineX + Scr->PannerOutlineWidth/2;
X!     pointerY = Scr->PannerOutlineY + Scr->PannerOutlineHeight/2;
X!     XWarpPointer(dpy, None, Scr->Panner, 0,0,0,0,
X! 	pointerX, pointerY);
X!     XClearWindow(dpy, Scr->Panner);
X!     XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
X! 	Scr->PannerOutlineX, Scr->PannerOutlineY,
X! 	Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X  }
X  
X  void
X--- 608,635 ----
X      XDrawRectangle(dpy, Scr->Panner, Scr->PannerGC,
X  	Scr->PannerOutlineX, Scr->PannerOutlineY,
X  	Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X+ 
X+     /* flush other expose events */
X+     while (XCheckTypedWindowEvent (dpy, Scr->Panner, Expose, &dummy)) ;
X  }
X  
X+ static int pannerButton = 0;
X+ 
X  void
X  HandlePannerButtonPress(ev)
X  XEvent *ev;
X  {
X!     if (!pannerButton) {
X! 	pannerButton = ev->xbutton.button;
X! 	pointerX = Scr->PannerOutlineX + Scr->PannerOutlineWidth/2;
X! 	pointerY = Scr->PannerOutlineY + Scr->PannerOutlineHeight/2;
X! 	XWarpPointer(dpy, None, Scr->Panner, 0,0,0,0,
X! 	    pointerX, pointerY);
X! 	XClearWindow(dpy, Scr->Panner);
X! 	XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
X! 	    Scr->PannerOutlineX, Scr->PannerOutlineY,
X! 	    Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X!     }
X  }
X  
X  void
X***************
X*** 626,641 ****
X  HandlePannerButtonRelease(ev)
X  XEvent *ev;
X  {
X!     XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
X! 	Scr->PannerOutlineX, Scr->PannerOutlineY,
X! 	Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X!     XClearWindow(dpy, Scr->Panner);
X!     XDrawRectangle(dpy, Scr->Panner, Scr->PannerGC,
X! 	Scr->PannerOutlineX, Scr->PannerOutlineY,
X! 	Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X  
X!     MoveDesktop(Scr->PannerOutlineX * Scr->PannerScale,
X! 	Scr->PannerOutlineY * Scr->PannerScale);
X  }
X  
X  void
X--- 636,654 ----
X  HandlePannerButtonRelease(ev)
X  XEvent *ev;
X  {
X!     if (ev->xbutton.button == pannerButton) {
X! 	pannerButton = 0;
X! 	XDrawRectangle(dpy, Scr->Panner, Scr->DrawGC,
X! 	    Scr->PannerOutlineX, Scr->PannerOutlineY,
X! 	    Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X! 	XClearWindow(dpy, Scr->Panner);
X! 	XDrawRectangle(dpy, Scr->Panner, Scr->PannerGC,
X! 	    Scr->PannerOutlineX, Scr->PannerOutlineY,
X! 	    Scr->PannerOutlineWidth, Scr->PannerOutlineHeight);
X  
X! 	MoveDesktop(Scr->PannerOutlineX * Scr->PannerScale,
X! 	    Scr->PannerOutlineY * Scr->PannerScale);
X!     }
X  }
X  
X  void
X***************
X*** 732,741 ****
X   */
X  
X  void
X! ScrollDesktop(func)
X  int func;
X  {
X      int x, y;
X  
X      x = Scr->vdtPositionX;
X      y = Scr->vdtPositionY;
X--- 745,757 ----
X   */
X  
X  void
X! ScrollDesktop(func, pos)
X  int func;
X+ char *pos;
X  {
X      int x, y;
X+     int status;
X+     unsigned int width, height;
X  
X      x = Scr->vdtPositionX;
X      y = Scr->vdtPositionY;
X***************
X*** 742,763 ****
X  
X      switch (func)
X      {
X  	case F_SCROLLHOME:
X  	    x = 0;
X  	    y = 0;
X  	    break;
X! 	case F_SCROLLRIGHT:
X! 	    x += Scr->MyDisplayWidth;
X! 	    break;
X! 	case F_SCROLLLEFT:
X! 	    x -= Scr->MyDisplayWidth;
X! 	    break;
X! 	case F_SCROLLDOWN:
X! 	    y += Scr->MyDisplayHeight;
X! 	    break;
X! 	case F_SCROLLUP:
X! 	    y -= Scr->MyDisplayHeight;
X! 	    break;
X      }
X      if (x < 0)
X  	x = 0;
X--- 758,789 ----
X  
X      switch (func)
X      {
X+ 	case F_SCROLL:
X+ 	    status = XParseGeometry(pos, &x, &y, &width, &height);
X+ 	    if ((status & (XValue & YValue)) != (XValue & YValue)) {
X+ 		fprintf (stderr,
X+ 			 "twm: ignoring invalid f.scroll geometry \"%s\"\n", pos);
X+ 		return;
X+ 	    }
X+ 	    x = abs(x) * Scr->MyDisplayWidth;
X+ 	    y = abs(y) * Scr->MyDisplayHeight;
X+ 	    break;
X  	case F_SCROLLHOME:
X  	    x = 0;
X  	    y = 0;
X  	    break;
X!   	case F_SCROLLRIGHT:
X!  	    x += Scr->vdtScrollDistanceX;
X!   	    break;
X!   	case F_SCROLLLEFT:
X!  	    x -= Scr->vdtScrollDistanceX;
X!   	    break;
X!   	case F_SCROLLDOWN:
X!  	    y += Scr->vdtScrollDistanceY;
X!   	    break;
X!   	case F_SCROLLUP:
X!  	    y -= Scr->vdtScrollDistanceY;
X!   	    break;
X      }
X      if (x < 0)
X  	x = 0;
X***************
X*** 848,854 ****
X  	objHeight = tmp_win->frame_height + 2*tmp_win->frame_bw;
X      }
X      else {
X! 	moving_frame - False;
X  	objWidth = tmp_win->icon_w_width + 2;
X  	objHeight = tmp_win->icon_w_height + 2;
X      }
X--- 874,880 ----
X  	objHeight = tmp_win->frame_height + 2*tmp_win->frame_bw;
X      }
X      else {
X! 	moving_frame = False;
X  	objWidth = tmp_win->icon_w_width + 2;
X  	objHeight = tmp_win->icon_w_height + 2;
X      }
Xdiff -c ./version.c ../new/version.c
X*** ./version.c	Thu Aug 30 07:18:05 1990
X--- ../new/version.c	Tue Sep  4 23:56:49 1990
X***************
X*** 26,30 ****
X  /*****************************************************************************/
X  
X  /* char *Version = "MIT X Consortium, R4"; */
X! char *Version = "$Revision: 5.0 $";
X  
X--- 26,30 ----
X  /*****************************************************************************/
X  
X  /* char *Version = "MIT X Consortium, R4"; */
X! char *Version = "$Revision: 6.0 $";
X  
SHAR_EOF
if test 34123 -ne "`wc -c < patch.2`"
then
    echo shar: error transmitting "patch.2" '(should have been 34123 characters)'
fi
fi
# end of shell archive
exit 0

dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.