diff -u -r xfce-3.1.2/xfpager/XfwmPager.h xfce-3.1.2.autodesk/xfpager/XfwmPager.h
--- xfce-3.1.2/xfpager/XfwmPager.h	Wed Aug 25 14:07:46 1999
+++ xfce-3.1.2.autodesk/xfpager/XfwmPager.h	Wed Oct 13 17:44:48 1999
@@ -29,6 +29,11 @@
   Pixmap sticky_gray_pixmap;
   Pixmap light_gray_pixmap;
   Pixmap gray_pixmap;
+  
+  /* AutoDeskSwitch */
+  int EdgeScrollX;
+  int EdgeScrollY;
+  int SnapSize;
 
 } ScreenInfo;
 
diff -u -r xfce-3.1.2/xfpager/x_pager.c xfce-3.1.2.autodesk/xfpager/x_pager.c
--- xfce-3.1.2/xfpager/x_pager.c	Wed Aug 25 14:07:46 1999
+++ xfce-3.1.2.autodesk/xfpager/x_pager.c	Wed Oct 13 22:42:07 1999
@@ -373,6 +373,15 @@
   gcv.background = back_pix;
   gcv.line_style = LineOnOffDash;
   DashedGC = XCreateGC(dpy, Scr.Root, gcm, &gcv);
+  
+  /* AutoDesk */
+  XSelectInput (dpy, Scr.Root, PointerMotionMask);
+  Scr.SnapSize = 8; /*FIXME: make this settable via configfile */
+  Scr.EdgeScrollX = Scr.EdgeScrollY = 0; 
+  { char command[256];
+    sprintf(command, "DeskSize %i %i", Rows, Columns); /* autodesk-only -gud*/
+    SendInfo (fd, command, 0);
+  }
 }
 
 
@@ -450,6 +459,11 @@
 	}
       break;
     case MotionNotify:
+      if (Event->xmotion.window == Scr.Root) {
+         HandleRootMotionNotify(Event);
+         break;
+      }
+    
       while(XCheckMaskEvent(dpy, PointerMotionMask | ButtonMotionMask,Event));
 
       if(Event->xmotion.state == Button3MotionMask)
@@ -1536,3 +1550,82 @@
     }
 
 }
+
+
+/***********************************************************************
+ *
+ *  Procedure:
+ *	HandleMotionNotify - LeaveNotify event handler
+ *
+ ************************************************************************/
+static int deskwrap (int horz, int vert)
+{
+  int desk = Scr.CurrentDesk;
+  if (horz) {
+     desk += Rows*horz;
+     while (desk >= ndesks) { desk -= Columns*Rows; }
+     while (desk < 0) { desk += Columns*Rows; }
+  }
+  if (vert) {
+     desk += vert;
+     if (desk/Rows > (Scr.CurrentDesk)/Rows) { desk -= Rows; }
+     if (desk/Rows < (Scr.CurrentDesk)/Rows) { desk += Rows; }
+  }
+  return desk;
+}
+ 
+void
+HandleRootMotionNotify (XEvent* Event)
+{
+  /* If we leave the root window, then we're really moving
+   * another screen on a multiple screen display */
+   
+                         /* is this check really useful? -gud */
+  if (Event->xmotion.window == Scr.Root)
+    {
+      if (Scr.SnapSize) 
+        {
+          if (Event->xmotion.x_root == 0) {
+             Scr.EdgeScrollX--;
+          }else
+          if (Event->xmotion.y_root == 0) {
+             Scr.EdgeScrollY--;
+          }else
+          if (Event->xmotion.x_root >= Scr.MyDisplayWidth-1) {
+             Scr.EdgeScrollX++;
+          }else
+          if (Event->xmotion.y_root >= Scr.MyDisplayHeight-1) {
+             Scr.EdgeScrollY++;
+          }else{
+             Scr.EdgeScrollY = Scr.EdgeScrollX = 0;
+          }
+          
+          if (Scr.EdgeScrollX <= -Scr.SnapSize) {
+             /* move desktop left */
+             SwitchToDesk (deskwrap(-1,0));
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, +(Scr.MyDisplayWidth-Scr.SnapSize),(0));
+          }else
+          if (Scr.EdgeScrollX >= +Scr.SnapSize) {
+             /* move desktop right */
+             SwitchToDesk (deskwrap(+1,0));
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, -(Scr.MyDisplayWidth-Scr.SnapSize),(0));
+          }else
+          if (Scr.EdgeScrollY <= -Scr.SnapSize) {
+             /* move desktop upper */
+             SwitchToDesk (deskwrap(0,-1));
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, (0),+(Scr.MyDisplayHeight-Scr.SnapSize));
+          }else
+          if (Scr.EdgeScrollY >= +Scr.SnapSize) {
+             /* move desktop lower */
+             SwitchToDesk (deskwrap(0,+1));
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, (0),-(Scr.MyDisplayHeight-Scr.SnapSize));
+          }
+	}
+    }
+}
+
+
diff -u -r xfce-3.1.2/xfwm/builtins.c xfce-3.1.2.autodesk/xfwm/builtins.c
--- xfce-3.1.2/xfwm/builtins.c	Tue Sep 28 22:26:06 1999
+++ xfce-3.1.2.autodesk/xfwm/builtins.c	Wed Oct 13 23:36:55 1999
@@ -1275,6 +1275,29 @@
 }
 
 void
+setDeskSize (XEvent * eventp, Window w, XfwmWindow * tmp_win,
+	     unsigned long context, char *action, int *Module)
+{
+  int val1, val2, val1_unit, val2_unit, n;
+
+  n = GetTwoArguments (action, &val1, &val2, &val1_unit, &val2_unit);
+  if (n != 2)
+    {
+      xfwm_msg (ERR, "setDeskSize", "DesktopSize requires two arguments");
+      return;
+    }
+  if ((val1_unit != Scr.MyDisplayWidth) ||
+      (val2_unit != Scr.MyDisplayHeight))
+    {
+      xfwm_msg (ERR, "setDeskSize", "DeskTopSize arguments should be unitless");
+    }
+
+  /*new style -gud*/
+  Scr.vdesk_rows = val1 ? val1 : 1;
+  Scr.vdesk_cols = val2 ? val2 : 1;
+}
+
+void
 setModulePath (XEvent * eventp, Window w, XfwmWindow * tmp_win,
 	       unsigned long context, char *action, int *Module)
 {
diff -u -r xfce-3.1.2/xfwm/functions.c xfce-3.1.2.autodesk/xfwm/functions.c
--- xfce-3.1.2/xfwm/functions.c	Wed Aug 25 14:07:48 1999
+++ xfce-3.1.2.autodesk/xfwm/functions.c	Wed Oct 13 22:41:24 1999
@@ -57,6 +57,7 @@
   {"CursorMove", movecursor, F_MOVECURSOR, FUNC_NO_WINDOW},
   {"Delete", delete_function, F_DELETE, FUNC_NEEDS_WINDOW},
   {"Desk", changeDesks_func, F_DESK, FUNC_NO_WINDOW},
+  {"DeskSize", setDeskSize, F_SETDESK, FUNC_NO_WINDOW}, /*new style -gud*/
   {"DesktopSize", SetDeskSize, F_SETDESK, FUNC_NO_WINDOW},
   {"Destroy", destroy_function, F_DESTROY, FUNC_NEEDS_WINDOW},
   {"DestroyFunc", destroy_menu, F_DESTROY_MENU, FUNC_NO_WINDOW},
diff -u -r xfce-3.1.2/xfwm/misc.h xfce-3.1.2.autodesk/xfwm/misc.h
--- xfce-3.1.2/xfwm/misc.h	Tue Sep 28 22:26:06 1999
+++ xfce-3.1.2.autodesk/xfwm/misc.h	Wed Oct 13 22:43:07 1999
@@ -457,6 +457,8 @@
  * void AddTitleStyle(XEvent *eventp,Window w,XfwmWindow *tmp_win,
  * unsigned long context, char *action,int* Module);
  */
+void setDeskSize (XEvent * eventp, Window w, XfwmWindow * tmp_win,
+		  unsigned long context, char *action, int *Module);
 void SetDeskSize (XEvent * eventp, Window w, XfwmWindow * tmp_win,
 		  unsigned long context, char *action, int *Module);
 void SetXOR (XEvent * eventp, Window w, XfwmWindow * tmp_win,
diff -u -r xfce-3.1.2/xfwm/move.c xfce-3.1.2.autodesk/xfwm/move.c
--- xfce-3.1.2/xfwm/move.c	Thu Sep 30 07:56:38 1999
+++ xfce-3.1.2.autodesk/xfwm/move.c	Wed Oct 13 22:09:30 1999
@@ -100,6 +100,96 @@
   return;
 }
 
+static int deskwrap (int horz, int vert)
+{
+  register int desk = Scr.CurrentDesk;
+  register int ndesks = Scr.vdesk_cols*Scr.vdesk_rows;
+  
+  if (horz) {
+     desk += Scr.vdesk_rows*horz;
+     while (desk >= ndesks) { desk -= Scr.vdesk_cols*Scr.vdesk_rows; }
+     while (desk < 0) { desk += Scr.vdesk_cols*Scr.vdesk_rows; }
+  }
+  if (vert) {
+     desk += vert;
+     if (desk/Scr.vdesk_rows > (Scr.CurrentDesk)/Scr.vdesk_rows) { desk -= Scr.vdesk_rows; }
+     if (desk/Scr.vdesk_rows < (Scr.CurrentDesk)/Scr.vdesk_rows) { desk += Scr.vdesk_rows; }
+  }
+
+  return desk;
+}
+
+void
+XfwmMoveWindow (XfwmWindow* tmp_win, int xl, int yt, int x_root, int y_root)
+{
+  if (!Scr.SnapSize)
+   {
+     XMoveWindow (dpy, tmp_win->frame, xl, yt);
+     return;
+   }
+   
+      if (Scr.SnapSize) 
+        {
+          if (x_root == 0) {
+             Scr.EdgeScrollX--;
+          }else
+          if (y_root == 0) {
+             Scr.EdgeScrollY--;
+          }else
+          if (x_root >= Scr.MyDisplayWidth-1) {
+             Scr.EdgeScrollX++;
+          }else
+          if (y_root >= Scr.MyDisplayHeight-1) {
+             Scr.EdgeScrollY++;
+          }else{
+             Scr.EdgeScrollY = Scr.EdgeScrollX = 0;
+          }
+          
+          if (Scr.EdgeScrollX <= -Scr.SnapSize) {
+             /* move desktop left */
+             /* UnmapIt (tmp_win); */
+             tmp_win->Desk = deskwrap(-1,0);
+             XMoveWindow (dpy, tmp_win->frame, xl+(Scr.MyDisplayWidth-Scr.SnapSize),(yt));
+             BroadcastConfig (M_CONFIGURE_WINDOW, tmp_win);
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, +(Scr.MyDisplayWidth-Scr.SnapSize),(0));
+             changeDesks (0, tmp_win->Desk);
+          }else
+          if (Scr.EdgeScrollX >= +Scr.SnapSize) {
+             /* move desktop right */
+             /* UnmapIt (tmp_win); */
+             tmp_win->Desk = deskwrap(+1,0);
+             XMoveWindow (dpy, tmp_win->frame, xl-(Scr.MyDisplayWidth-Scr.SnapSize),(yt));
+             BroadcastConfig (M_CONFIGURE_WINDOW, tmp_win);
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, -(Scr.MyDisplayWidth-Scr.SnapSize),(0));
+             changeDesks (0, tmp_win->Desk);
+          }else
+          if (Scr.EdgeScrollY <= -Scr.SnapSize) {
+             /* move desktop upper */
+             /* UnmapIt (tmp_win); */
+             tmp_win->Desk = deskwrap(0,-1);
+             XMoveWindow (dpy, tmp_win->frame, (xl), yt+(Scr.MyDisplayHeight-Scr.SnapSize));
+             BroadcastConfig (M_CONFIGURE_WINDOW, tmp_win);
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, (0),+(Scr.MyDisplayHeight-Scr.SnapSize));
+             changeDesks (0, tmp_win->Desk);
+          }else
+          if (Scr.EdgeScrollY >= +Scr.SnapSize) {
+             /* move desktop lower */
+             /* UnmapIt (tmp_win); */
+             tmp_win->Desk = deskwrap(0,+1);
+             XMoveWindow (dpy, tmp_win->frame, (xl), yt-(Scr.MyDisplayHeight-Scr.SnapSize));
+             BroadcastConfig (M_CONFIGURE_WINDOW, tmp_win);
+             Scr.EdgeScrollX = Scr.EdgeScrollY = 0;
+             XWarpPointer (dpy, None, None, 0,0,0,0, (0),-(Scr.MyDisplayHeight-Scr.SnapSize));
+             changeDesks (0, tmp_win->Desk);
+          }else{
+             XMoveWindow (dpy, tmp_win->frame, xl, yt);
+          }
+	}
+}
+
 void
 moveLoop (XfwmWindow * tmp_win, int XOffset, int YOffset, int Width,
 	  int Height, int *FinalX, int *FinalY, register Bool opaque_move,
@@ -222,7 +312,7 @@
 
 		    }
 		  else
-		    XMoveWindow (dpy, tmp_win->frame, xl, yt);
+                   XfwmMoveWindow (tmp_win, xl, yt, Event.xmotion.x_root, Event.xmotion.y_root);
 		}
 	  done = TRUE;
 	  break;
Only in xfce-3.1.2.autodesk/xfwm: move.c.orig
diff -u -r xfce-3.1.2/xfwm/screen.h xfce-3.1.2.autodesk/xfwm/screen.h
--- xfce-3.1.2/xfwm/screen.h	Thu Aug 26 22:35:52 1999
+++ xfce-3.1.2.autodesk/xfwm/screen.h	Wed Oct 13 21:10:34 1999
@@ -280,6 +280,7 @@
     int VyMax;
     int Vx;			/* Current loc for top left of virt desk */
     int Vy;
+    int vdesk_rows, vdesk_cols; /* autodesk style -gud*/
 
     int ClickTime;		/*Max button-click delay for Function built-in */
     int AutoRaiseDelay;         /* Delay between setting focus and raising win*/
