--- gnome-panel-2.21.92/applets/wncklet/workspace-switcher.c	2008-02-26 07:17:48.000000000 -0600
+++ gnome-panel-2.21.92.new/applets/wncklet/workspace-switcher.c	2008-03-06 10:29:32.000000000 -0600
@@ -242,21 +242,15 @@
                PagerData      *pager)
 {
 	GdkScrollDirection absolute_direction;
-	int                index;
-	int                n_workspaces;
-	int                n_columns;
-	int                in_last_row;
+	gboolean           viewport_mode;
 	
 	if (event->type != GDK_SCROLL)
 		return FALSE;
 
-	index          = wnck_workspace_get_number (wnck_screen_get_active_workspace (pager->screen));
-	n_workspaces   = wnck_screen_get_workspace_count (pager->screen);
-	n_columns      = n_workspaces / pager->n_rows;
-	if (n_workspaces % pager->n_rows != 0)
-		n_columns++;
-	in_last_row    = n_workspaces % n_columns;
-	
+	viewport_mode = wnck_screen_get_workspace_count (pager->screen) == 1 &&
+                  wnck_workspace_is_virtual (wnck_screen_get_workspace (pager->screen,
+                                                                        0));
+
 	absolute_direction = event->direction;
 	if (gtk_widget_get_direction (GTK_WIDGET (applet)) == GTK_TEXT_DIR_RTL) {
 		switch (event->direction) {
@@ -272,44 +266,130 @@
 		}
 	}
 
-	switch (absolute_direction) {
-	case GDK_SCROLL_DOWN:
-		if (index + n_columns < n_workspaces)
-			index += n_columns;
-		else if ((index < n_workspaces - 1
-			  && index + in_last_row != n_workspaces - 1) ||
-			 (index == n_workspaces - 1
-			  && in_last_row != 0))
-			index = (index % n_columns) + 1;
-		break;
+	if (!viewport_mode) {
+		int                index;
+		int                n_workspaces;
+		int                n_columns;
+		int                in_last_row;
+
+		index          = wnck_workspace_get_number (wnck_screen_get_active_workspace (pager->screen));
+		n_workspaces   = wnck_screen_get_workspace_count (pager->screen);
+		n_columns      = n_workspaces / pager->n_rows;
+		if (n_workspaces % pager->n_rows != 0)
+			n_columns++;
+		in_last_row    = n_workspaces % n_columns;
+
+		switch (absolute_direction) {
+		case GDK_SCROLL_DOWN:
+			if (index + n_columns < n_workspaces)
+				index += n_columns;
+			else if ((index < n_workspaces - 1
+				  && index + in_last_row != n_workspaces - 1) ||
+				 (index == n_workspaces - 1
+				  && in_last_row != 0))
+				index = (index % n_columns) + 1;
+			break;
 		
-	case GDK_SCROLL_RIGHT:
-		if (index < n_workspaces - 1)
-			index++;
-		break;
+		case GDK_SCROLL_RIGHT:
+			if (index < n_workspaces - 1)
+				index++;
+			break;
 		
-	case GDK_SCROLL_UP:
-		if (index - n_columns >= 0)
-			index -= n_columns;
-		else if (index > 0)
-			index = ((pager->n_rows - 1) * n_columns) + (index % n_columns) - 1;
-			if (index >= n_workspaces)
+		case GDK_SCROLL_UP:
+			if (index - n_columns >= 0)
 				index -= n_columns;
-		break;
+			else if (index > 0)
+				index = ((pager->n_rows - 1) * n_columns) + (index % n_columns) - 1;
+				if (index >= n_workspaces)
+					index -= n_columns;
+			break;
 
-	case GDK_SCROLL_LEFT:
-		if (index > 0)
-			index--;
-		break;
-	default:
-		g_assert_not_reached ();
-		break;
+		case GDK_SCROLL_LEFT:
+			if (index > 0)
+				index--;
+			break;
+		default:
+			g_assert_not_reached ();
+			break;
+		}
+
+		wnck_workspace_activate (wnck_screen_get_workspace (pager->screen,
+								    index),
+					 event->time);
+	}
+	else {
+		int viewport_x, viewport_y;
+		int viewport_width, viewport_height;
+		int screen_width, screen_height;
+		int n_columns, n_rows;
+		gboolean in_last_row, in_last_col;
+		WnckWorkspace *workspace;
+
+		workspace = wnck_screen_get_workspace (pager->screen, 0);
+
+		viewport_x = wnck_workspace_get_viewport_x (workspace);
+		viewport_y = wnck_workspace_get_viewport_y (workspace);
+
+		viewport_width = wnck_workspace_get_width (workspace);
+		viewport_height = wnck_workspace_get_height (workspace);
+
+		screen_width = wnck_screen_get_width (pager->screen);
+		screen_height = wnck_screen_get_height (pager->screen);
+
+		n_columns = viewport_width / screen_width;
+		n_rows = viewport_height / screen_height;
+		in_last_row = viewport_y == viewport_height - screen_height;
+		in_last_col = viewport_x == viewport_width - screen_width;
+
+		switch (absolute_direction) {
+		case GDK_SCROLL_DOWN:
+			if (in_last_col) {
+				if (in_last_row)
+					break;
+				else
+					viewport_y += screen_height;
+				viewport_x = 0;
+			}
+			else {
+				viewport_x += screen_width;
+			}
+			break;
+		
+		case GDK_SCROLL_RIGHT:
+			if (viewport_y == 0)
+				viewport_y = viewport_height - screen_height;
+			else
+				viewport_y -= screen_height;
+			break;
+		
+		case GDK_SCROLL_UP:
+			if (viewport_x == 0)
+			{
+				if (viewport_y == 0)
+					break;
+				else
+					viewport_y -= screen_height;
+				viewport_x = viewport_width - screen_width;
+			}
+			else {
+				viewport_x -= screen_width;
+			}
+			break;
+
+		case GDK_SCROLL_LEFT:
+			if (in_last_row)
+				viewport_y = 0;
+			else
+				viewport_y += screen_height;
+			break;
+		default:
+			g_assert_not_reached ();
+			break;
+		}
+
+		wnck_screen_move_viewport (pager->screen, viewport_x, viewport_y);
 	}
 
-	wnck_workspace_activate (wnck_screen_get_workspace (pager->screen,
-							    index),
-				 event->time);
-	
 	return TRUE;
 }
 
