Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/metacity/ChangeLog,v
retrieving revision 1.222
diff -u -r1.222 ChangeLog
--- ChangeLog	4 May 2002 23:40:11 -0000	1.222
+++ ChangeLog	5 May 2002 00:00:04 -0000
@@ -1,3 +1,10 @@
+2002-05-05  Bastien Nocera  <hadess@hadess.net>
+
+	* src/workspace.c: (meta_workspace_get_neighbor):
+	Wrap-around workspaces (ie. when on the last workspace,
+	"switch_to_workspace_right" goes back to the
+	first one)
+
 2002-05-05  Anders Carlsson  <andersca@gnu.org>
 
 	* src/metacity.schemas: Fix a spelling error and change 
Index: src/workspace.c
===================================================================
RCS file: /cvs/gnome/metacity/src/workspace.c,v
retrieving revision 1.15
diff -u -r1.15 workspace.c
--- src/workspace.c	28 Apr 2002 15:47:21 -0000	1.15
+++ src/workspace.c	5 May 2002 00:00:05 -0000
@@ -487,7 +487,7 @@
   /* FIXME this isn't using any sane layout, just assuming
    * the spaces are in a big row
    */
-  int i;
+  int i, num_workspaces;
   
   i = meta_workspace_index (workspace);
 
@@ -503,6 +503,13 @@
     case META_MOTION_DOWN:
       return NULL;
     }
+
+  /* Wrap from the last workspace to the first one, and vice-versa */
+  num_workspaces = g_list_length (workspace->screen->display->workspaces);
+  if (i == num_workspaces + 1)
+    i = 0;
+  if (i == -1)
+    i = num_workspaces;
 
   return meta_display_get_workspace_by_index (workspace->screen->display,
                                               i);
