diff -ru -X excl.list libwnck-trunk.clean/libwnck/pager.c libwnck-work/libwnck/pager.c
--- libwnck-trunk.clean/libwnck/pager.c	2003-04-04 17:07:39.000000000 +0200
+++ libwnck-work/libwnck/pager.c	2003-09-23 23:12:52.000000000 +0200
@@ -1149,14 +1149,53 @@
 
 	  if (space)
             {
-              wnck_workspace_activate (space);
+#define MOVE_VIEWPORT_IN_SCREEN_SIZE_STEPS 1
+#if MOVE_VIEWPORT_IN_SCREEN_SIZE_STEPS
+              int screen_width, screen_height;
+#else /* MOVE_VIEWPORT_CENTERED_ON_PONTER */
+              int screen_width, screen_height, max_x, max_y;
+#endif
+
+              /* Don't switch the desktop if we're already there */
+              if (space != wnck_screen_get_active_workspace (pager->priv->screen))
+                wnck_workspace_activate (space);
 
               /* EWMH only lets us move the viewport for the active workspace,
                * but we just go ahead and hackily assume that the activate
                * just above takes effect prior to moving the viewport
                */
-              wnck_screen_move_viewport (pager->priv->screen,
-                                         viewport_x, viewport_y);
+              screen_width = wnck_screen_get_width (pager->priv->screen);
+              screen_height = wnck_screen_get_height (pager->priv->screen);
+#if MOVE_VIEWPORT_IN_SCREEN_SIZE_STEPS
+              /* Transform the pointer location to viewport origin, assuming
+               * that we want the nearest "regular" viewport containing the
+               * pointer.
+               */
+              viewport_x = (viewport_x / screen_width) * screen_width;
+              viewport_y = (viewport_y / screen_height) * screen_height;
+#else /* MOVE_VIEWPORT_CENTERED_ON_PONTER */
+              /* Transform the pointer location to viewport origin, assuming
+               * that we want the pointer centered in the viewport.
+               * Keep the viewport entirely on the desktop.
+               */
+              max_x = wnck_workspace_get_width (space) - screen_width;
+              max_y = wnck_workspace_get_height (space) - screen_height;
+              viewport_x -= screen_width / 2;
+              if (viewport_x < 0)
+                viewport_x = 0;
+              else if (viewport_x > max_x)
+                viewport_x = max_x;
+              viewport_y -= screen_height / 2;
+              if (viewport_y < 0)
+                viewport_y = 0;
+              else if (viewport_y > max_y)
+                viewport_y = max_y;
+#endif
+              
+              if (wnck_workspace_get_viewport_x(space) != viewport_x ||
+                  wnck_workspace_get_viewport_y(space) != viewport_y)
+                wnck_screen_move_viewport (pager->priv->screen,
+                                           viewport_x, viewport_y);
               
               if (pager->priv->drag_window)
                 wnck_window_activate (pager->priv->drag_window);
