[comp.windows.x] tvtwm patch 4

toml@ninja.Solbourne.COM (Tom LaStrange) (11/16/90)

#! /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.4
#
# Created by toml () on Thu Nov 15 20:25:42 MST 1990
#
if test -f 'patch.4'
then
    echo shar: will not over-write existing file "patch.4"
else
echo extracting "patch.4"
sed 's/^X//' >patch.4 <<'SHAR_EOF'
Xtvtwm patch 4
X
XThis patch fixes the following problems:
X
X 1.  The first and most significant item is that sticky windows can
X     now be lowered!  Sticky windows are not "really" sticky, when
X     you pan the desktop, you will see the sticky windows move back
X     on the screen.  If you like your sticky windows on top, put "StickyAbove"
X     in your .{tv}twmrc file. Special thanks to Alain Brossard
X     (brossard@sasun1.epfl.ch) for supplying the code.  Send your thanks to
X     him, I just cleaned up a couple of things and turned it into an option.
X 2.  MoveOpaque operations really look slick now, they should also be faster.
X     Eric A. Anderson <uunet!andrew.cmu.edu!ea08+> supplied the code.
X 3.  Icons no longer disappears for other desktop quadrants.
X 4.  Desktop sized to multiples of dimensions if smaller than
X     screen size.  (wmk@fed.frb.gov)
X 5.  Bug in fullzoom that could cause half-sticky icons
X     (uunet!sasun1.epfl.ch!brossard)  Hey, there's that brossard guy again!
X 6.  I fixed my "fix" to window zooming so windows should not get smaller.
X
X
Xdiff -c ../old/README.tvtwm ./README.tvtwm
X*** ../old/README.tvtwm	Mon Oct  1 19:53:26 1990
X--- ./README.tvtwm	Thu Nov 15 20:13:06 1990
X***************
X*** 72,91 ****
X     didn't touch any code related to window moves in events.c.
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     not move when the desktop is panned are called "sticky" windows.
X     There is a command called f.stick and a "Sticky" list of windows
X!    that will be sticky when started.  Also, a side effect/feature
X!    of the way sticky windows are impemented means that sticky
X!    windows will always be on top of non-sticky windows.  The sticky-ness
X!    of a window is remembered during an f.restart if RestartPreviousState
X!    is set.
X  
X! 5. USPosition vs. PPosition - When a window has USPosition hints
X     set, the window will be positioned at that exact pixel location.
X     When PPosition hints are set, the window will be positioned at 
X     the pixel location plus the current offset of the Virtual Desktop.
X--- 72,88 ----
X     didn't touch any code related to window moves in events.c.
X     The new window move code is in a new file called move.c.
X  
X! 3. Rather than the f.nail and "NailedDown" features of vtwm, tvtwm
X     uses the same terminology as swm.  In tvtwm, windows that do
X     not move when the desktop is panned are called "sticky" windows.
X     There is a command called f.stick and a "Sticky" list of windows
X!    that will be sticky when started.  Sticky windows used to always
X!    be physically above non-sticky windows.  This is no longer the case 
X!    but if you have gotten used to it, you can place the "StickyAbove"
X!    keyword in your .{tv}twmrc file.  The sticky-ness of a window is
X!    remembered during an f.restart if RestartPreviousState is set.
X  
X! 4. USPosition vs. PPosition - When a window has USPosition hints
X     set, the window will be positioned at that exact pixel location.
X     When PPosition hints are set, the window will be positioned at 
X     the pixel location plus the current offset of the Virtual Desktop.
X***************
X*** 93,108 ****
X     a window is mapped with PPosition +100+100, the window will be
X     positioned at +300+600 on the desktop.
X  
X! 6. How does the icon gravity stuff work in relation to different areas
X     of the Virtual Desktop?  I don't know, and I don't really have the
X     time to look into the problem.  It might be nice to have seperate icon
X     regions in different quadrants of the Virtual Desktop.  If you use
X     icon managers and make them sticky then you don't have any problems.
X  
X! 7. The small "virtual" windows in the panner will have the same color
X!    as their corresponding window titlebars and icons have.
X! 
X! 8. The initialization files .tvtwmrc.<screen number> and .tvtwmrc will
X     be attempted before .twmrc.<screen number> .twmrc.
X  
X  
X--- 90,102 ----
X     a window is mapped with PPosition +100+100, the window will be
X     positioned at +300+600 on the desktop.
X  
X! 5. How does the icon gravity stuff work in relation to different areas
X     of the Virtual Desktop?  I don't know, and I don't really have the
X     time to look into the problem.  It might be nice to have seperate icon
X     regions in different quadrants of the Virtual Desktop.  If you use
X     icon managers and make them sticky then you don't have any problems.
X  
X! 6. The initialization files .tvtwmrc.<screen number> and .tvtwmrc will
X     be attempted before .twmrc.<screen number> .twmrc.
X  
X  
X***************
X*** 167,172 ****
X--- 161,169 ----
X  
X  Sticky { window list }
X    A list of windows that will come up in a sticky state.
X+ 
X+ StickyAbove
X+   Causes sticky windows to always be physically above non-sticky windows.
X  
X  NoIconTitle [ { window list } ]
X    Specifies that no titles should be displayed below icons.  If the
Xdiff -c ../old/add_window.c ./add_window.c
X*** ../old/add_window.c	Mon Oct  1 19:53:26 1990
X--- ./add_window.c	Thu Nov 15 20:13:07 1990
X***************
X*** 479,485 ****
X      }
X  
X      if (Scr->VirtualDesktop) {
X! 	if (tmp_win->sticky)
X  	    tmp_win->root = Scr->Root;
X  	else
X  	    tmp_win->root = Scr->VirtualDesktop;
X--- 479,485 ----
X      }
X  
X      if (Scr->VirtualDesktop) {
X! 	if (tmp_win->sticky && Scr->StickyAbove)
X  	    tmp_win->root = Scr->Root;
X  	else
X  	    tmp_win->root = Scr->VirtualDesktop;
Xdiff -c ../old/events.c ./events.c
X*** ../old/events.c	Mon Oct  1 19:53:27 1990
X--- ./events.c	Thu Nov 15 20:13:08 1990
X***************
X*** 32,37 ****
X--- 32,57 ----
X   *
X   * twm event handling
X   *
X+  * $Log:	events.c,v $
X+  * Revision 8.0  90/11/15  20:02:36  toml
X+  * Revision bump
X+  * 
X+  * Revision 7.4  90/11/13  15:06:56  toml
X+  * More fixes
X+  * 
X+  * Revision 7.3  90/11/12  21:34:49  toml
X+  * Implemented Scr->StickyAbove
X+  * 
X+  * Revision 7.2  90/11/12  19:57:17  toml
X+  * Patches to allow sticky windows to lower
X+  * 
X+  * Revision 1.2  90/11/04  18:34:20  brossard
X+  *  When non-sticky client provide their own icons, don't forget to
X+  * reparent the new icon.
X+  * Removed the test above for stickyness since all windows are now child
X+  * of the virtual root.
X+  * 
X+  *
X   * 17-Nov-87 Thomas E. LaStrange		File created
X   *
X   ***********************************************************************/
X***************
X*** 763,778 ****
X  		/*
X  		 * There's already an icon window.
X  		 * Try to find out where it is; if we succeed, move the new
X! 		 * window to where the old one is.
X  		 */
X  		if (XGetGeometry (dpy, Tmp_win->icon_w, &JunkRoot, &icon_x,
X  		  &icon_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) {
X  		    /*
X! 		     * Move the new icon window to where the old one was.
X  		     */
X! 		    XMoveWindow(dpy, Tmp_win->wmhints->icon_window, icon_x,
X! 		      icon_y);
X  		}
X  
X  		/*
X  		 * If the window is iconic, map the new icon window.
X--- 783,807 ----
X  		/*
X  		 * There's already an icon window.
X  		 * Try to find out where it is; if we succeed, move the new
X! 		 * window to where the old one is.  Take into account
X! 		 * that it may need to be reparented to the virtual root
X  		 */
X  		if (XGetGeometry (dpy, Tmp_win->icon_w, &JunkRoot, &icon_x,
X  		  &icon_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) {
X  		    /*
X! 		     * Reparent and Move the new icon window to
X! 		     * where the old one was.
X  		     */
X! 		    if (Scr->VirtualDesktop && (!Tmp_win->sticky || !Scr->StickyAbove))
X! 			XReparentWindow (dpy, Tmp_win->wmhints->icon_window,
X! 			    Tmp_win->root, icon_x, icon_y);
X! 		    else
X! 			XMoveWindow(dpy, Tmp_win->wmhints->icon_window, icon_x,
X! 			    icon_y);
X  		}
X+ 		else if (Scr->VirtualDesktop && (!Tmp_win->sticky || !Scr->StickyAbove))
X+ 		    XReparentWindow (dpy, Tmp_win->wmhints->icon_window,
X+ 			    Tmp_win->root, icon_x, icon_y);
X  
X  		/*
X  		 * If the window is iconic, map the new icon window.
X***************
X*** 923,929 ****
X  
X      Tmp_win->icon_w_height = Tmp_win->icon_height;
X      if (Tmp_win->icon_title)
X! 	Tmp_win->icon_w_height += Tmp_win->icon_height;
X      Tmp_win->icon_y = Tmp_win->icon_height + Scr->IconFont.height;
X  
X      XResizeWindow(dpy, Tmp_win->icon_w, Tmp_win->icon_w_width,
X--- 952,958 ----
X  
X      Tmp_win->icon_w_height = Tmp_win->icon_height;
X      if (Tmp_win->icon_title)
X! 	Tmp_win->icon_w_height += Scr->IconFont.height + 4;
X      Tmp_win->icon_y = Tmp_win->icon_height + Scr->IconFont.height;
X  
X      XResizeWindow(dpy, Tmp_win->icon_w, Tmp_win->icon_w_width,
X***************
X*** 1236,1244 ****
X  {
X  #ifdef DEBUG_EVENTS
X      fprintf(stderr, "CreateNotify w = 0x%x\n", Event.xcreatewindow.window);
X-     fflush(stderr);
X-     XBell(dpy, 0);
X-     XSync(dpy, 0);
X  #endif
X  
X      /* OI clients will actually create windows on the virtual desktop window,
X--- 1265,1270 ----
X***************
X*** 1253,1258 ****
X--- 1279,1289 ----
X  void
X  HandleReparentNotify()
X  {
X+ #ifdef DEBUG_EVENTS
X+     fprintf(stderr, "ReparentNotify w = 0x%x,  parent = 0x%x\n", Event.xreparent.window,
X+ 		Event.xreparent.parent);
X+ #endif
X+ 
X      /* OI clients will actually create windows on the virtual desktop window,
X       * we need to save these just in case we get killed without being able
X       * to clean things up
Xdiff -c ../old/icons.c ./icons.c
X*** ../old/icons.c	Mon Oct  1 19:53:28 1990
X--- ./icons.c	Thu Nov 15 20:13:10 1990
X***************
X*** 25,30 ****
X--- 25,47 ----
X   *
X   * Icon releated routines
X   *
X+  * $Log:	icons.c,v $
X+  * Revision 8.0  90/11/15  20:02:40  toml
X+  * Revision bump
X+  * 
X+  * Revision 7.3  90/11/12  21:34:53  toml
X+  * Implemented Scr->StickyAbove
X+  * 
X+  * Revision 7.2  90/11/12  19:57:23  toml
X+  * Patches to allow sticky windows to lower
X+  * 
X+  * Revision 1.2  90/11/04  18:30:24  brossard
X+  * When non-sticky client provide their own icons, don't forget to
X+  * reparent the root.
X+  * Removed the test above for stickyness since all windows are now child
X+  * of the virtual root.
X+  * 
X+  *
X   * 10-Apr-89 Tom LaStrange        Initial Version.
X   *
X   **********************************************************************/
X***************
X*** 191,196 ****
X--- 208,217 ----
X      defx = -100;
X      defy = -100;
X      PlaceIcon(tmp_win, defx, defy, &x, &y);
X+     if (tmp_win->root == Scr->VirtualDesktop) {
X+ 	defx += Scr->vdtPositionX;
X+ 	defy += Scr->vdtPositionY;
X+     }
X      if (x != defx || y != defy) {
X  	MoveIcon(tmp_win, x, y);
X  	tmp_win->icon_moved = FALSE;	/* since we've restored it */
X***************
X*** 517,522 ****
X--- 538,549 ----
X  	else
X  	{
X  	    tmp_win->icon_not_ours = TRUE;
X+ 	    /*
X+ 	     * We need to reparent to take into account the virtual root
X+ 	     */
X+ 	    if (Scr->VirtualDesktop && (!tmp_win->sticky || !Scr->StickyAbove))
X+ 		XReparentWindow (dpy, tmp_win->wmhints->icon_window,
X+ 			tmp_win->root, tmp_win->icon_x, tmp_win->icon_y);
X  	}
X      }
X      else
Xdiff -c ../old/menus.c ./menus.c
X*** ../old/menus.c	Mon Oct  1 19:53:30 1990
X--- ./menus.c	Thu Nov 15 20:13:12 1990
X***************
X*** 32,37 ****
X--- 32,61 ----
X   *
X   * twm menu code
X   *
X+  * $Log:	menus.c,v $
X+  * Revision 8.0  90/11/15  20:02:43  toml
X+  * Revision bump
X+  * 
X+  * Revision 7.4  90/11/15  19:59:42  toml
X+  * removed a printf from a patch
X+  * 
X+  * Revision 7.3  90/11/12  22:05:00  toml
X+  * Applied opaque move patches
X+  * 
X+  * Revision 7.2  90/11/12  21:34:54  toml
X+  * Implemented Scr->StickyAbove
X+  * 
X+  * Revision 7.1  90/11/12  19:57:25  toml
X+  * Patches to allow sticky windows to lower
X+  * 
X+  * Revision 1.2  90/11/04  18:38:22  brossard
X+  * Sticky windows are now child of the virtual root.
X+  * This has the advantage that they can now be raised and lowered like
X+  * any other window.  They no longuer are above everything else.
X+  * It has the disadvantage that when you move the desktop, the
X+  * sticky windows have to be moved back after scrolling the desktop.
X+  * 
X+  *
X   * 17-Nov-87 Thomas E. LaStrange		File created
X   *
X   ***********************************************************************/
X***************
X*** 464,469 ****
X--- 488,496 ----
X      int i, x, y, x_root, y_root, entry;
X      int done;
X      MenuItem *badItem = NULL;
X+     Window aJunkRoot,aJunkChild;
X+     unsigned int aJunkMask;
X+     int a_type;
X  
X      while (TRUE)
X      {
X***************
X*** 470,477 ****
X  	while (XCheckMaskEvent(dpy, ButtonPressMask | ButtonReleaseMask |
X  	    EnterWindowMask | ExposureMask, &Event))
X  	{
X  	    if (!DispatchEvent ()) continue;
X! 	    if (Event.type == ButtonRelease || Cancel)
X  		return;
X  	}
X  
X--- 497,505 ----
X  	while (XCheckMaskEvent(dpy, ButtonPressMask | ButtonReleaseMask |
X  	    EnterWindowMask | ExposureMask, &Event))
X  	{
X+ 	    a_type = Event.type;
X  	    if (!DispatchEvent ()) continue;
X! 	    if (a_type == ButtonRelease || Cancel)
X  		return;
X  	}
X  
X***************
X*** 480,487 ****
X  	    continue;
X  
X  	done = FALSE;
X! 	XQueryPointer( dpy, ActiveMenu->w, &JunkRoot, &JunkChild,
X! 	    &x_root, &y_root, &x, &y, &JunkMask);
X  
X  	XFindContext(dpy, ActiveMenu->w, ScreenContext, (caddr_t *)&Scr);
X  
X--- 508,515 ----
X  	    continue;
X  
X  	done = FALSE;
X! 	XQueryPointer( dpy, ActiveMenu->w, &aJunkRoot, &aJunkChild,
X! 	    &x_root, &y_root, &x, &y, &aJunkMask);
X  
X  	XFindContext(dpy, ActiveMenu->w, ScreenContext, (caddr_t *)&Scr);
X  
X***************
X*** 1240,1289 ****
X  	    Window junkChild;
X  
X  	    if (tmp_win->sticky) {
X! 		XReparentWindow(dpy, tmp_win->frame, Scr->VirtualDesktop,
X! 		    tmp_win->frame_x + Scr->vdtPositionX,
X! 		    tmp_win->frame_y + Scr->vdtPositionY);
X! 		tmp_win->frame_x += Scr->vdtPositionX;
X! 		tmp_win->frame_y += Scr->vdtPositionY;
X! 		XMoveWindow(dpy, tmp_win->virtualWindow,
X! 		    tmp_win->frame_x / Scr->PannerScale,
X! 		    tmp_win->frame_y / Scr->PannerScale);
X! 		if (tmp_win->icon_w) {
X! 		    XReparentWindow(dpy, tmp_win->icon_w, Scr->VirtualDesktop,
X! 			tmp_win->icon_loc_x + Scr->vdtPositionX,
X! 			tmp_win->icon_loc_y + Scr->vdtPositionY);
X! 		    tmp_win->icon_loc_x += Scr->vdtPositionX;
X! 		    tmp_win->icon_loc_y += Scr->vdtPositionY;
X! 		    XMoveWindow(dpy, tmp_win->virtualIcon,
X! 			tmp_win->icon_loc_x / Scr->PannerScale,
X! 			tmp_win->icon_loc_y / Scr->PannerScale);
X  		}
X  		if (!tmp_win->icon)
X  		    XMapRaised(dpy, tmp_win->virtualWindow);
X  		else if (tmp_win->virtualIcon)
X  		    XMapRaised(dpy, tmp_win->virtualIcon);
X- 		tmp_win->root = Scr->VirtualDesktop;
X  		tmp_win->sticky = False;
X  		SetSWM_ROOT(tmp_win);
X  		SetTWM_FLAGS(tmp_win);
X  	    }
X  	    else {
X! 		XReparentWindow(dpy, tmp_win->frame, Scr->Root,
X! 		    tmp_win->frame_x - Scr->vdtPositionX,
X! 		    tmp_win->frame_y - Scr->vdtPositionY);
X! 		tmp_win->frame_x -= Scr->vdtPositionX;
X! 		tmp_win->frame_y -= Scr->vdtPositionY;
X! 		if (tmp_win->icon_w) {
X! 		    XReparentWindow(dpy, tmp_win->icon_w, Scr->Root,
X! 			tmp_win->icon_loc_x - Scr->vdtPositionX,
X! 			tmp_win->icon_loc_y - Scr->vdtPositionY);
X! 		    tmp_win->icon_loc_x -= Scr->vdtPositionX;
X! 		    tmp_win->icon_loc_y -= Scr->vdtPositionY;
X  		}
X  		XUnmapWindow(dpy, tmp_win->virtualWindow);
X  		if (tmp_win->virtualIcon)
X  		    XUnmapWindow(dpy, tmp_win->virtualIcon);
X- 		tmp_win->root = Scr->Root;
X  		tmp_win->sticky = True;
X  		SetSWM_ROOT(tmp_win);
X  		SetTWM_FLAGS(tmp_win);
X--- 1268,1321 ----
X  	    Window junkChild;
X  
X  	    if (tmp_win->sticky) {
X! 		if (Scr->StickyAbove) {
X! 		    XReparentWindow(dpy, tmp_win->frame, Scr->VirtualDesktop,
X! 			tmp_win->frame_x + Scr->vdtPositionX,
X! 			tmp_win->frame_y + Scr->vdtPositionY);
X! 		    tmp_win->frame_x += Scr->vdtPositionX;
X! 		    tmp_win->frame_y += Scr->vdtPositionY;
X! 		    XMoveWindow(dpy, tmp_win->virtualWindow,
X! 			tmp_win->frame_x / Scr->PannerScale,
X! 			tmp_win->frame_y / Scr->PannerScale);
X! 		    if (tmp_win->icon_w) {
X! 			XReparentWindow(dpy, tmp_win->icon_w, Scr->VirtualDesktop,
X! 			    tmp_win->icon_loc_x + Scr->vdtPositionX,
X! 			    tmp_win->icon_loc_y + Scr->vdtPositionY);
X! 			tmp_win->icon_loc_x += Scr->vdtPositionX;
X! 			tmp_win->icon_loc_y += Scr->vdtPositionY;
X! 			XMoveWindow(dpy, tmp_win->virtualIcon,
X! 			    tmp_win->icon_loc_x / Scr->PannerScale,
X! 			    tmp_win->icon_loc_y / Scr->PannerScale);
X! 		    }
X! 		    tmp_win->root = Scr->VirtualDesktop;
X  		}
X  		if (!tmp_win->icon)
X  		    XMapRaised(dpy, tmp_win->virtualWindow);
X  		else if (tmp_win->virtualIcon)
X  		    XMapRaised(dpy, tmp_win->virtualIcon);
X  		tmp_win->sticky = False;
X  		SetSWM_ROOT(tmp_win);
X  		SetTWM_FLAGS(tmp_win);
X  	    }
X  	    else {
X! 		if (Scr->StickyAbove) {
X! 		    XReparentWindow(dpy, tmp_win->frame, Scr->Root,
X! 			tmp_win->frame_x - Scr->vdtPositionX,
X! 			tmp_win->frame_y - Scr->vdtPositionY);
X! 		    tmp_win->frame_x -= Scr->vdtPositionX;
X! 		    tmp_win->frame_y -= Scr->vdtPositionY;
X! 		    if (tmp_win->icon_w) {
X! 			XReparentWindow(dpy, tmp_win->icon_w, Scr->Root,
X! 			    tmp_win->icon_loc_x - Scr->vdtPositionX,
X! 			    tmp_win->icon_loc_y - Scr->vdtPositionY);
X! 			tmp_win->icon_loc_x -= Scr->vdtPositionX;
X! 			tmp_win->icon_loc_y -= Scr->vdtPositionY;
X! 		    }
X! 		    tmp_win->root = Scr->Root;
X  		}
X  		XUnmapWindow(dpy, tmp_win->virtualWindow);
X  		if (tmp_win->virtualIcon)
X  		    XUnmapWindow(dpy, tmp_win->virtualIcon);
X  		tmp_win->sticky = True;
X  		SetSWM_ROOT(tmp_win);
X  		SetTWM_FLAGS(tmp_win);
Xdiff -c ../old/move.c ./move.c
X*** ../old/move.c	Mon Oct  1 19:53:30 1990
X--- ./move.c	Thu Nov 15 20:13:13 1990
X***************
X*** 203,209 ****
X  	XTranslateCoordinates(dpy, Scr->Root, tmp_win->root, dragX, dragY, x_root, y_root, &junkChild);
X      }
X  
X!     if (tmp_win->root != Scr->Root /*  && !Scr->OpaqueMove */)
X  	doingMove = True;
X      outlineWindow = tmp_win->root;
X      scale = move_scale;
X--- 203,209 ----
X  	XTranslateCoordinates(dpy, Scr->Root, tmp_win->root, dragX, dragY, x_root, y_root, &junkChild);
X      }
X  
X!     if (!tmp_win->sticky)
X  	doingMove = True;
X      outlineWindow = tmp_win->root;
X      scale = move_scale;
X***************
X*** 227,233 ****
X  	XTranslateCoordinates(dpy, Scr->Root, outlineWindow,
X  	    0, 0, &offsetX, &offsetY, &junkChild);
X  
X! 	reallyStartMove(tmp_win, window, x_root, y_root, cancel, outlineWindow, &first, adding, pulldown);
X  
X  	if (*cancel == IN_PANNER)
X  	{
X--- 227,233 ----
X  	XTranslateCoordinates(dpy, Scr->Root, outlineWindow,
X  	    0, 0, &offsetX, &offsetY, &junkChild);
X  
X! 	reallyStartMove(tmp_win, window, x_root, y_root, cancel, outlineWindow, &first, adding, pulldown, panner);
X  
X  	if (*cancel == IN_PANNER)
X  	{
X***************
X*** 295,301 ****
X  
X  static void
X  reallyStartMove(tmp_win, window, x_root, y_root,
X!     cancel, outlineWindow, first, adding, pulldown)
X  TwmWindow *tmp_win;
X  Window window;
X  int *x_root;
X--- 295,301 ----
X  
X  static void
X  reallyStartMove(tmp_win, window, x_root, y_root,
X!     cancel, outlineWindow, first, adding, pulldown,panner)
X  TwmWindow *tmp_win;
X  Window window;
X  int *x_root;
X***************
X*** 305,310 ****
X--- 305,311 ----
X  int *first;
X  int adding;
X  int pulldown;
X+ int panner;
X  {
X      int xdest, ydest;
X      int done;
X***************
X*** 322,328 ****
X  	if (done)
X  	    break;
X  	if (!*cancel)
X! 	    doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest);
X      }
X  
X      *x_root = xdest;
X--- 323,329 ----
X  	if (done)
X  	    break;
X  	if (!*cancel)
X! 	    doMove(tmp_win, window, *x_root, *y_root, &xdest, &ydest, panner);
X      }
X  
X      *x_root = xdest;
X***************
X*** 330,336 ****
X  }
X  
X  static void
X! doMove(tmp_win, window, x_root, y_root, x_dest, y_dest)
X  TwmWindow *tmp_win;
X  Window window;
X  int x_root;
X--- 331,337 ----
X  }
X  
X  static void
X! doMove(tmp_win, window, x_root, y_root, x_dest, y_dest, panner)
X  TwmWindow *tmp_win;
X  Window window;
X  int x_root;
X***************
X*** 337,342 ****
X--- 338,344 ----
X  int y_root;
X  int *x_dest;
X  int *y_dest;
X+ int panner;
X  {
X      int xl, yt;
X      int deltax, deltay;
X***************
X*** 371,376 ****
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***************
X*** 468,473 ****
X--- 476,482 ----
X                  }
X  		break;
X  	    case MotionNotify:
X+  		while(XCheckTypedEvent(dpy,MotionNotify,&event));
X  		if (!WindowMoved &&
X  		    (abs(event.xmotion.x_root - rootX) >= Scr->MoveDelta ||
X  		     abs(event.xmotion.y_root - rootY) >= Scr->MoveDelta))
Xdiff -c ../old/parse.c ./parse.c
X*** ../old/parse.c	Mon Oct  1 19:53:30 1990
X--- ./parse.c	Thu Nov 15 20:13:14 1990
X***************
X*** 341,346 ****
X--- 341,347 ----
X  #define kw0_NoRaiseOnWarp		24
X  #define kw0_WarpUnmapped		25
X  #define kw0_ShowVirtualNames		26
X+ #define kw0_StickyAbove			27
X  
X  #define kws_UsePPosition		1
X  #define kws_IconFont			2
X***************
X*** 597,602 ****
X--- 598,604 ----
X      { "squeezetitle",		SQUEEZE_TITLE, 0 },
X      { "starticonified",		START_ICONIFIED, 0 },
X      { "sticky",			STICKY, 0 },
X+     { "stickyabove",		KEYWORD, kw0_StickyAbove },
X      { "t",			TITLE, 0 },
X      { "title",			TITLE, 0 },
X      { "titlebackground",	CLKEYWORD, kwcl_TitleBackground },
X***************
X*** 667,672 ****
X--- 669,678 ----
X  	Scr->NoDefaults = TRUE;
X  	return 1;
X  
X+       case kw0_StickyAbove:
X+ 	Scr->StickyAbove = TRUE;
X+ 	return 1;
X+ 
X        case kw0_AutoRelativeResize:
X  	Scr->AutoRelativeResize = TRUE;
X  	return 1;
X***************
X*** 1038,1045 ****
X  	return 1;
X  
X        case kwc_VirtualDesktopBackground:
X! 	GetColor (colormode, &Scr->vdtC.back, s);
X! 	Scr->vdtBackgroundSet = True;
X  	return 1;
X  
X        case kwc_VirtualDesktopForeground:
X--- 1044,1051 ----
X  	return 1;
X  
X        case kwc_VirtualDesktopBackground:
X! 	if (GetColor (colormode, &Scr->vdtC.back, s))
X! 	    Scr->vdtBackgroundSet = True;
X  	return 1;
X  
X        case kwc_VirtualDesktopForeground:
Xdiff -c ../old/patchlevel.h ./patchlevel.h
X*** ../old/patchlevel.h	Mon Oct  1 19:53:31 1990
X--- ./patchlevel.h	Thu Nov 15 20:13:14 1990
X***************
X*** 1 ****
X! #define PATCHLEVEL 3
X--- 1 ----
X! #define PATCHLEVEL 4
Xdiff -c ../old/resize.c ./resize.c
X*** ../old/resize.c	Mon Oct  1 19:53:31 1990
X--- ./resize.c	Thu Nov 15 20:13:15 1990
X***************
X*** 32,37 ****
X--- 32,55 ----
X   *
X   * window resizing borrowed from the "wm" window manager
X   *
X+  * $Log:	resize.c,v $
X+  * Revision 8.0  90/11/15  20:02:49  toml
X+  * Revision bump
X+  * 
X+  * Revision 7.3  90/11/12  21:34:57  toml
X+  * Implemented Scr->StickyAbove
X+  * 
X+  * Revision 7.2  90/11/12  19:57:29  toml
X+  * Patches to allow sticky windows to lower
X+  * 
X+  * Revision 1.2  90/11/04  18:38:30  brossard
X+  * Sticky windows are now child of the virtual root.
X+  * This has the advantage that they can now be raised and lowered like
X+  * any other window.  They no longuer are above everything else.
X+  * It has the disadvantage that when you move the desktop, the
X+  * sticky windows have to be moved back after scrolling the desktop.
X+  * 
X+  *
X   * 11-Dec-87 Thomas E. LaStrange                File created
X   *
X   ***********************************************************************/
X***************
X*** 828,834 ****
X      client_event.xconfigure.x = (tmp_win->frame_x + tmp_win->frame_bw - tmp_win->old_bw);
X      client_event.xconfigure.y = (tmp_win->frame_y + tmp_win->frame_bw +
X  				 tmp_win->title_height - tmp_win->old_bw);
X!     if (Scr->VirtualDesktop && !tmp_win->sticky) {
X  	client_event.xconfigure.x -= Scr->vdtPositionX;
X  	client_event.xconfigure.y -= Scr->vdtPositionY;
X      }
X--- 846,853 ----
X      client_event.xconfigure.x = (tmp_win->frame_x + tmp_win->frame_bw - tmp_win->old_bw);
X      client_event.xconfigure.y = (tmp_win->frame_y + tmp_win->frame_bw +
X  				 tmp_win->title_height - tmp_win->old_bw);
X! 
X!     if (Scr->VirtualDesktop && (!tmp_win->sticky || !Scr->StickyAbove)) {
X  	client_event.xconfigure.x -= Scr->vdtPositionX;
X  	client_event.xconfigure.y -= Scr->vdtPositionY;
X      }
X***************
X*** 867,878 ****
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--- 886,898 ----
X      Window      junkRoot;
X      unsigned int junkbw, junkDepth;
X      int basex, basey;
X+     int frame_bw_times_2;
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***************
X*** 903,949 ****
X                              tmp_win->zoomed = flag;
X  
X  
X          switch (flag)
X          {
X          case ZOOM_NONE:
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;
X           }
X        }
X--- 923,971 ----
X                              tmp_win->zoomed = flag;
X  
X  
X+ 	frame_bw_times_2 = 2*tmp_win->frame_bw;
X+ 
X          switch (flag)
X          {
X          case ZOOM_NONE:
X              break;
X          case F_ZOOM:
X!             dragHeight = Scr->MyDisplayHeight - frame_bw_times_2;
X              dragy=basey;
X              break;
X          case F_HORIZOOM:
X              dragx = basex;
X!             dragWidth = Scr->MyDisplayWidth - frame_bw_times_2;
X              break;
X          case F_FULLZOOM:
X              dragx = basex;
X              dragy = basey;
X!             dragHeight = Scr->MyDisplayHeight - frame_bw_times_2;
X!             dragWidth = Scr->MyDisplayWidth - frame_bw_times_2;
X              break;
X          case F_LEFTZOOM:
X              dragx = basex;
X              dragy = basey;
X!             dragHeight = Scr->MyDisplayHeight - frame_bw_times_2;
X!             dragWidth = Scr->MyDisplayWidth/2 - frame_bw_times_2;
X              break;
X          case F_RIGHTZOOM:
X              dragx = basex + Scr->MyDisplayWidth/2;
X              dragy = basey;
X!             dragHeight = Scr->MyDisplayHeight - frame_bw_times_2;
X!             dragWidth = Scr->MyDisplayWidth/2 - frame_bw_times_2;
X              break;
X          case F_TOPZOOM:
X              dragx = basex;
X              dragy = basey;
X!             dragHeight = Scr->MyDisplayHeight/2 - frame_bw_times_2;
X!             dragWidth = Scr->MyDisplayWidth - frame_bw_times_2;
X              break;
X          case F_BOTTOMZOOM:
X              dragx = basex;
X              dragy = basey + Scr->MyDisplayHeight/2;
X!             dragHeight = Scr->MyDisplayHeight/2 - frame_bw_times_2;
X!             dragWidth = Scr->MyDisplayWidth - frame_bw_times_2;
X              break;
X           }
X        }
X***************
X*** 952,960 ****
X          RaiseFrame(dpy, tmp_win);
X  
X      dragHeight -= tmp_win->title_height;
X- 
X-     dragHeight -= 2*tmp_win->frame_bw;
X-     dragWidth -= 2*tmp_win->frame_bw;
X  
X      if (tmp_win->hints.flags&PMinSize && tmp_win->hints.flags & PResizeInc)
X      {
X--- 974,979 ----
Xdiff -c ../old/screen.h ./screen.h
X*** ../old/screen.h	Mon Oct  1 19:53:31 1990
X--- ./screen.h	Thu Nov 15 20:13:15 1990
X***************
X*** 276,281 ****
X--- 276,282 ----
X      char *vdtPixmap;		/* vdt pixmap */
X      short PannerBackgroundSet;	/* background of panner is set */
X      char *PannerPixmap;		/* Panner pixmap */
X+     short StickyAbove;		/* should sticky windows be above? */
X  
X      FuncKey FuncKeyRoot;
X  } ScreenInfo;
Xdiff -c ../old/tvtwm.man ./tvtwm.man
X*** ../old/tvtwm.man	Mon Oct  1 19:53:33 1990
X--- ./tvtwm.man	Thu Nov 15 20:13:17 1990
X***************
X*** 196,203 ****
X  Along with the Virtual Desktop comes a concept called ``sticky''
X  windows.  Sticky windows can be thought of as stuck to the glass
X  of the display.  Sticky windows do not scroll when the desktop
X! is scrolled.  Sticky windows are also always above non-sticky 
X! windows, they cannot be lowered behind non-sticky windows.
X  .SH VARIABLES
X  .PP
X  Many of the aspects of \fItwm\fP's user interface are controlled by variables
X--- 196,202 ----
X  Along with the Virtual Desktop comes a concept called ``sticky''
X  windows.  Sticky windows can be thought of as stuck to the glass
X  of the display.  Sticky windows do not scroll when the desktop
X! is scrolled.
X  .SH VARIABLES
X  .PP
X  Many of the aspects of \fItwm\fP's user interface are controlled by variables
X***************
X*** 809,814 ****
X--- 808,815 ----
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  description of sticky windows.
X+ .IP "\fBStickyAbove\fP" 8
X+ This variable causes sticky windows to be physically above non-sticky windows.
X  .IP "\fBTitleBackground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8
X  This variable specifies the background color used in titlebars,
X  and may only be specified inside of a 
X***************
X*** 854,865 ****
X  older toolkits.
X  .IP "\fBVirtualDesktop\fP \fIstring\fP" 8
X  This variable enables the Virtual Desktop feature and specifies
X! the initial size of the desktop in pixels.
X  The size is specified as a standard geometry string.
X! If the width and height values are smaller than the width and
X! height of the physical display, they are defaulted to two times
X! the width or height.  So to get a 2x2 sized Virtual Desktop
X! across all platforms, one could use the string "1x1" to enable
X  the desktop.
X  .IP "\fBVirtualDesktopBackgroundPixmap\fP \fIstring\fP" 8
X  This variable specifies the filename of a bitmap file to be
X--- 855,868 ----
X  older toolkits.
X  .IP "\fBVirtualDesktop\fP \fIstring\fP" 8
X  This variable enables the Virtual Desktop feature and specifies
X! the initial size of the desktop, either in pixels or in integral multiples
X! of the screen size.
X  The size is specified as a standard geometry string.
X! If a width or height value is smaller than the width or
X! height of the physical display, it is assumed to mean a multiple of the
X! screen size, otherwise it is assumed to be in pixels.
X! So to get a 2x2 sized Virtual Desktop
X! across all platforms, one could use the string "2x2" to enable
X  the desktop.
X  .IP "\fBVirtualDesktopBackgroundPixmap\fP \fIstring\fP" 8
X  This variable specifies the filename of a bitmap file to be
X***************
X*** 869,875 ****
X  .IP "\fBWarpCursor\fP [{ \fIwin-list\fP }]" 8
X  This variable indicates that the pointer should be warped into windows when
X  they are deiconified.  If the optional \fIwin-list\fP is given, the pointer
X! will only be warped when those windows are deiconified.
X  .IP "\fBVirtualFont\fP \fIfont\fP" 8
X  This is the font used to display window names in the small windows inside
X  the panner if the \fBShowVirtualNames\fP variable is specified.  The default
X--- 872,880 ----
X  .IP "\fBWarpCursor\fP [{ \fIwin-list\fP }]" 8
X  This variable indicates that the pointer should be warped into windows when
X  they are deiconified.  If the optional \fIwin-list\fP is given, the pointer
X! will only be warped when those windows are deiconified.  This will
X! also change the position of the virtual desktop if the unmapped window
X! wasn't visible from the actual position.
X  .IP "\fBVirtualFont\fP \fIfont\fP" 8
X  This is the font used to display window names in the small windows inside
X  the panner if the \fBShowVirtualNames\fP variable is specified.  The default
Xdiff -c ../old/twm.c ./twm.c
X*** ../old/twm.c	Mon Oct  1 19:53:33 1990
X--- ./twm.c	Thu Nov 15 20:13:18 1990
X***************
X*** 32,37 ****
X--- 32,58 ----
X   *
X   * twm - "Tom's Window Manager"
X   *
X+  * $Log:	twm.c,v $
X+  * Revision 8.0  90/11/15  20:02:53  toml
X+  * Revision bump
X+  * 
X+  * Revision 7.3  90/11/13  15:06:59  toml
X+  * More fixes
X+  * 
X+  * Revision 7.2  90/11/12  20:57:10  toml
X+  * Added StickyAbove variable
X+  * 
X+  * Revision 7.1  90/11/12  19:57:32  toml
X+  * Patches to allow sticky windows to lower
X+  * 
X+  * Revision 1.2  90/11/04  18:38:33  brossard
X+  * Sticky windows are now child of the virtual root.
X+  * This has the advantage that they can now be raised and lowered like
X+  * any other window.  They no longuer are above everything else.
X+  * It has the disadvantage that when you move the desktop, the
X+  * sticky windows have to be moved back after scrolling the desktop.
X+  * 
X+  *
X   * 27-Oct-87 Thomas E. LaStrange	File created
X   *
X   ***********************************************************************/
X***************
X*** 200,206 ****
X  	exit (1);
X      }
X  
X!     /* XSynchronize(dpy, True); /* */
X  
X      if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) {
X  	fprintf (stderr, 
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***************
X*** 669,674 ****
X--- 690,696 ----
X      Scr->CaseSensitive = TRUE;
X      Scr->WarpUnmapped = FALSE;
X      Scr->NoIconTitle = FALSE;
X+     Scr->StickyAbove = FALSE;
X  
X      /* setup default fonts; overridden by defaults from system.twmrc */
X  #define DEFAULT_NICE_FONT "variable"
X***************
X*** 792,798 ****
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--- 814,819 ----
X***************
X*** 806,820 ****
X              int x, y;
X              unsigned int width, height, bw, depth;
X  
X!             XQueryTree(dpy, Scr->VirtualDesktop, &root_return,&parent_return, &children, &num_children);
X! 
X!             for (i = 0; i < num_children; i++)
X              {
X! 		XGetGeometry(dpy, children[i], &root_return, &x, &y, &width, &height, &bw, &depth);
X! 		XReparentWindow(dpy, children[i], Scr->Root, x, y);
X! 		XRemoveFromSaveSet(dpy, children[i]);
X              }
X          }
X      }
X  
X      XUngrabServer (dpy);
X--- 827,854 ----
X              int x, y;
X              unsigned int width, height, bw, depth;
X  
X! 	    for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next)
X              {
X! 		XGetGeometry(dpy, tmp->frame, &root_return, &x, &y, &width, &height, &bw, &depth);
X! 		if(tmp->sticky && !Scr->StickyAbove)
X! 			XReparentWindow(dpy, tmp->frame, Scr->Root, x - Scr->vdtPositionX, y - Scr->vdtPositionY );
X! 		else
X! 			XReparentWindow(dpy, tmp->frame, Scr->Root, x, y);
X! 		XRemoveFromSaveSet(dpy, tmp->frame);
X              }
X+ 
X+             XQueryTree(dpy, Scr->VirtualDesktop, &root_return,&parent_return, &children, &num_children);
X+ 	    for (i = 0; i < num_children; i++)
X+ 	    {
X+ 		    XGetGeometry(dpy, children[i], &root_return, &x, &y, &width, &height, &bw, &depth);
X+ 		    XReparentWindow(dpy, children[i], Scr->Root, x, y);
X+ 		    XRemoveFromSaveSet(dpy, children[i]);
X+ 	    }
X          }
X+ 	for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next)
X+ 	{
X+ 	    XDeleteProperty(dpy, tmp->w, XA_SWM_ROOT);
X+ 	}
X      }
X  
X      XUngrabServer (dpy);
Xdiff -c ../old/util.c ./util.c
X*** ../old/util.c	Mon Oct  1 19:53:33 1990
X--- ./util.c	Thu Nov 15 20:13:18 1990
X***************
X*** 479,484 ****
X--- 479,485 ----
X      return;
X  }
X  
X+ int
X  GetColor(kind, what, name)
X  int kind;
X  Pixel *what;
X***************
X*** 488,500 ****
X      Status stat = 0;
X      Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c;
X  
X- #ifndef TOM
X-     if (!Scr->FirstTime)
X- 	return;
X- #endif
X- 
X      if (Scr->Monochrome != kind)
X! 	return;
X  
X      /*
X       * small hack to avoid extra roundtrip for color allocation
X--- 489,496 ----
X      Status stat = 0;
X      Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c;
X  
X      if (Scr->Monochrome != kind)
X! 	return FALSE;
X  
X      /*
X       * small hack to avoid extra roundtrip for color allocation
X***************
X*** 516,522 ****
X  	{
X  	    fprintf (stderr, "%s:  invalid color name \"%s\"\n", 
X  		     ProgramName, name);
X! 	    return;
X  	}
X  
X  	/*
X--- 512,518 ----
X  	{
X  	    fprintf (stderr, "%s:  invalid color name \"%s\"\n", 
X  		     ProgramName, name);
X! 	    return FALSE;
X  	}
X  
X  	/*
X***************
X*** 558,568 ****
X          } else {
X  	    fprintf (stderr, "%s:  unable to allocate color \"%s\"\n", 
X  		     ProgramName, name);
X! 	    return;
X  	}
X      }
X  
X      *what = color.pixel;
X  }
X  
X  GetFont(font)
X--- 554,565 ----
X          } else {
X  	    fprintf (stderr, "%s:  unable to allocate color \"%s\"\n", 
X  		     ProgramName, name);
X! 	    return FALSE;
X  	}
X      }
X  
X      *what = color.pixel;
X+     return TRUE;
X  }
X  
X  GetFont(font)
Xdiff -c ../old/vdt.c ./vdt.c
X*** ../old/vdt.c	Mon Oct  1 19:53:34 1990
X--- ./vdt.c	Thu Nov 15 20:13:19 1990
X***************
X*** 27,32 ****
X--- 27,59 ----
X   *
X   * $XConsortium: vdt.c,v 1.140 90/03/23 11:42:33 jim Exp $
X   *
X+  * $Log:	vdt.c,v $
X+  * Revision 8.0  90/11/15  20:02:56  toml
X+  * Revision bump
X+  * 
X+  * Revision 7.4  90/11/12  21:34:52  toml
X+  * Implemented Scr->StickyAbove
X+  * 
X+  * Revision 7.3  90/11/12  20:39:37  toml
X+  * Fixes to stickyroot patches
X+  * 
X+  * Revision 7.2  90/11/12  19:57:21  toml
X+  * Patches to allow sticky windows to lower
X+  * 
X+  * Revision 1.3  90/11/04  19:23:50  brossard
X+  * When mapping a window and warping the cursor to it, only scroll
X+  * the desktop if the window is not visible on screen.  (This was
X+  * actually done in the previous revistion, this one just fixes
X+  * the maths to do it right).
X+  * 
X+  * Revision 1.2  90/11/04  18:38:36  brossard
X+  * Sticky windows are now child of the virtual root.
X+  * This has the advantage that they can now be raised and lowered like
X+  * any other window.  They no longuer are above everything else.
X+  * It has the disadvantage that when you move the desktop, the
X+  * sticky windows have to be moved back after scrolling the desktop.
X+  * 
X+  *
X   * Virtual Desktop routines
X   *
X   * 22-Aug-90 Tom LaStrange        Initial Version.
X***************
X*** 302,308 ****
X  {
X      XWindowChanges xwc;
X  
X!     if (tmp_win->sticky && Scr->VirtualDesktop) {
X  	xwc.sibling = Scr->VirtualDesktop;
X  	xwc.stack_mode = Above;
X  	XConfigureWindow(dpy, tmp_win->frame, CWSibling|CWStackMode, &xwc);
X--- 329,335 ----
X  {
X      XWindowChanges xwc;
X  
X!     if (Scr->StickyAbove && tmp_win->sticky && Scr->VirtualDesktop) {
X  	xwc.sibling = Scr->VirtualDesktop;
X  	xwc.stack_mode = Above;
X  	XConfigureWindow(dpy, tmp_win->frame, CWSibling|CWStackMode, &xwc);
X***************
X*** 390,396 ****
X  {
X      XWindowChanges xwc;
X  
X!     if (tmp_win->sticky && Scr->VirtualDesktop) {
X  	xwc.sibling = Scr->VirtualDesktop;
X  	xwc.stack_mode = Above;
X  	XConfigureWindow(dpy, tmp_win->icon_w, CWSibling|CWStackMode, &xwc);
X--- 417,423 ----
X  {
X      XWindowChanges xwc;
X  
X!     if (Scr->StickyAbove && tmp_win->sticky && Scr->VirtualDesktop) {
X  	xwc.sibling = Scr->VirtualDesktop;
X  	xwc.stack_mode = Above;
X  	XConfigureWindow(dpy, tmp_win->icon_w, CWSibling|CWStackMode, &xwc);
X***************
X*** 445,455 ****
X      XSetWindowAttributes attr;
X      unsigned attrMask;
X  
X      if (width < Scr->MyDisplayWidth)
X! 	    width = 2 * Scr->MyDisplayWidth;
X      if (height < Scr->MyDisplayHeight)
X! 	    height = 2 * Scr->MyDisplayHeight;
X! 
X      bm = None;
X      pm = None;
X      if (Scr->vdtPixmap) {
X--- 472,488 ----
X      XSetWindowAttributes attr;
X      unsigned attrMask;
X  
X+ /*
X+  *  Make vdt size an integral multiple of physical screen size
X+  *  if the given width and/or height are less than physical
X+  *  width and/or height.
X+  *  WM Kules, wmk@fed.frb.gov, Oct 15, 1990
X+  */
X      if (width < Scr->MyDisplayWidth)
X!        width = width * Scr->MyDisplayWidth;
X      if (height < Scr->MyDisplayHeight)
X!        height = height * Scr->MyDisplayHeight;
X!   
X      bm = None;
X      pm = None;
X      if (Scr->vdtPixmap) {
X***************
X*** 710,715 ****
X--- 743,749 ----
X  {
X      TwmWindow *tmp;
X      XEvent ev;
X+     register int delta_x, delta_y;
X  
X      if (x != Scr->vdtPositionX || y != Scr->vdtPositionY) {
X  	Scr->vdtSaveX = Scr->vdtPositionX;
X***************
X*** 723,734 ****
X  	XMoveWindow(dpy, Scr->VirtualDesktop, -x, -y);
X  	Scr->PannerOutlineX = x / Scr->PannerScale;
X  	Scr->PannerOutlineY = y / Scr->PannerScale;
X  	Scr->vdtPositionX = x;
X  	Scr->vdtPositionY = y;
X  
X! 	for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next)
X  	    if (!tmp->sticky)
X  		SendSyntheticConfigureNotify(tmp);
X  
X  	/* go repaint the panner */
X  	ev.xexpose.count = 0;
X--- 757,776 ----
X  	XMoveWindow(dpy, Scr->VirtualDesktop, -x, -y);
X  	Scr->PannerOutlineX = x / Scr->PannerScale;
X  	Scr->PannerOutlineY = y / Scr->PannerScale;
X+ 	delta_x = x - Scr->vdtPositionX; delta_y = y - Scr->vdtPositionY;
X  	Scr->vdtPositionX = x;
X  	Scr->vdtPositionY = y;
X  
X! 	for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next) {
X  	    if (!tmp->sticky)
X  		SendSyntheticConfigureNotify(tmp);
X+ 	    else if (!Scr->StickyAbove) {
X+ 		if (tmp->icon_w)
X+ 		    MoveIcon(tmp, tmp->icon_loc_x + delta_x, tmp->icon_loc_y + delta_y);
X+ 		SetupFrame( tmp, tmp->frame_x + delta_x, tmp->frame_y + delta_y,
X+ 				tmp->frame_width, tmp->frame_height, -1, True );
X+ 	    }
X+ 	}
X  
X  	/* go repaint the panner */
X  	ev.xexpose.count = 0;
X***************
X*** 969,981 ****
X  ScrollToQuadrant(tmp_win)
X  TwmWindow *tmp_win;
X  {
X!     int x, y;
X      int xr, yb;
X  
X      if (!tmp_win->sticky) {
X! 	x = (tmp_win->frame_x / Scr->MyDisplayWidth) * Scr->MyDisplayWidth;
X! 	y = (tmp_win->frame_y / Scr->MyDisplayHeight) * Scr->MyDisplayHeight;
X! 	MoveDesktop(x, y);
X      }
X  }
X  
X--- 1011,1031 ----
X  ScrollToQuadrant(tmp_win)
X  TwmWindow *tmp_win;
X  {
X!     register int x, y;
X      int xr, yb;
X  
X      if (!tmp_win->sticky) {
X! 	x=tmp_win->frame_x;
X! 	y=tmp_win->frame_y;
X! 	/* 16 is the average cursor width */
X! 	if ( x + tmp_win->frame_width < Scr->vdtPositionX + 16 ||
X! 		x >  Scr->vdtPositionX + Scr->MyDisplayWidth - 16 ||
X! 	     y + tmp_win->frame_height < Scr->vdtPositionY + 16 ||
X! 		y >  Scr->vdtPositionY + Scr->MyDisplayHeight - 16 ){
X! 	    x = (x / Scr->MyDisplayWidth) * Scr->MyDisplayWidth;
X! 	    y = (y / Scr->MyDisplayHeight) * Scr->MyDisplayHeight;
X! 	    MoveDesktop(x, y);
X! 	}
X      }
X  }
X  
Xdiff -c ../old/version.c ./version.c
X*** ../old/version.c	Mon Oct  1 19:53:34 1990
X--- ./version.c	Thu Nov 15 20:13:20 1990
X***************
X*** 26,30 ****
X  /*****************************************************************************/
X  
X  /* char *Version = "MIT X Consortium, R4"; */
X! char *Version = "$Revision: 7.0 $";
X  
X--- 26,30 ----
X  /*****************************************************************************/
X  
X  /* char *Version = "MIT X Consortium, R4"; */
X! char *Version = "$Revision: 8.0 $";
X  
SHAR_EOF
if test 44483 -ne "`wc -c < patch.4`"
then
    echo shar: error transmitting "patch.4" '(should have been 44483 characters)'
fi
fi
# end of shell archive
exit 0