--- metacity-2.4.55.orig/src/window.c	Wed Sep 10 17:43:49 2003
+++ metacity-2.4.55/src/window.c	Wed Sep 10 17:35:59 2003
@@ -5869,7 +5869,64 @@
       MetaRectangle work_area;
       
       meta_window_get_work_area (window, FALSE, &work_area);
-      
+ 
+      // Mongoose 2003.01.30, Quick and dirty edge flipping hack,
+      //   looks for mouse cursor touching edge during window drag
+#define EDGE_FLIPPING_HACK
+#ifdef EDGE_FLIPPING_HACK
+      if (1) // turnOnTheEvil
+      {
+	static int transition = 0;
+	int threshold = (window->rect.width/2);
+	int left = 0;
+
+	if (transition)
+	{
+	  if (!(x < work_area.x - (threshold + 16) ||
+		x > work_area.x + work_area.width - (threshold + 16)))
+	    transition = 0;
+	}
+	else if (x < work_area.x - threshold - 40 ||
+	    x > work_area.x + work_area.width - threshold)
+	{
+	  MetaWorkspace *workspace;
+
+	  transition = 1;	  
+	  workspace = window->screen->active_workspace;
+	  
+	  if (workspace)
+	  {
+	    int index = meta_workspace_index(workspace);
+	    
+	    if (x < work_area.x - threshold - 40)
+	    {
+	      ++index;
+	      left = 1;
+	      workspace = meta_workspace_get_neighbor(workspace, META_MOTION_LEFT);  
+	    }
+	    else
+	    {
+	      --index;
+	      
+	      if (index < 0)
+		index = 3;
+	      
+	      workspace = meta_workspace_get_neighbor(workspace, META_MOTION_RIGHT);
+	    }
+	  }
+	  
+	  // Hack to allow 'ringed' edge flipping needs to use index
+	  
+	  if (workspace)
+	  {
+	    meta_window_change_workspace(window, workspace);
+	    meta_workspace_activate(workspace);
+	  }
+	}
+      }
+#endif
+
+     
       /* (FIXME instead of TITLEBAR_LENGTH_ONSCREEN, get the actual
        * size of the menu control?).
        */
