? intltool-modules
? scroll-wheeling.patch
Index: applets/wncklet/workspace-switcher.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/wncklet/workspace-switcher.c,v
retrieving revision 1.63
diff -u -r1.63 workspace-switcher.c
--- applets/wncklet/workspace-switcher.c	13 Jan 2004 13:30:42 -0000	1.63
+++ applets/wncklet/workspace-switcher.c	14 Jan 2004 19:24:28 -0000
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * libwnck based pager applet.
  * (C) 2001 Alexander Larsson 
@@ -147,6 +147,60 @@
 		gtk_label_set_text (GTK_LABEL (pager->label_row_col), pager->orientation == GTK_ORIENTATION_HORIZONTAL ? _("rows") : _("columns"));	
 }
 
+static gboolean
+applet_scroll (PanelApplet *applet,
+               GdkEventScroll *event,
+               PagerData *pager)
+{
+	WnckScreen *screen = applet_get_screen (GTK_WIDGET (applet));
+	WnckWorkspace *active_workspace =
+		wnck_screen_get_active_workspace (screen);
+	int workspace_index = wnck_workspace_get_number (active_workspace);
+	int workspace_count = wnck_screen_get_workspace_count (screen);
+	int n_columns = workspace_count / pager->n_rows;
+	int n_rows = pager->n_rows;
+	int new_index = workspace_index;
+
+	WnckWorkspace *new_workspace;
+	
+	if (event->type != GDK_SCROLL)
+		return FALSE;
+	
+	switch (event->direction) {
+	case GDK_SCROLL_DOWN:
+		if (workspace_index + n_columns < workspace_count)
+			new_index = workspace_index + n_columns;
+		else if (workspace_index < workspace_count - 1)
+			new_index = workspace_index % n_columns + 1;
+		break;
+		
+	case GDK_SCROLL_RIGHT:
+		if (workspace_index < workspace_count)
+			new_index = workspace_index + 1;
+		break;
+		
+	case GDK_SCROLL_UP:
+		if (workspace_index - n_columns >= 0)
+			new_index = workspace_index - n_columns;
+		else if (workspace_index > 0) {
+			new_index = (n_rows - 1) * n_columns;
+			new_index += workspace_index % n_columns - 1;
+		}
+		break;
+
+	case GDK_SCROLL_LEFT:
+		if (workspace_index > 0)
+			new_index = workspace_index - 1;
+		break;
+	}
+
+	new_workspace = wnck_screen_get_workspace (screen, new_index);
+	if (new_workspace)
+		wnck_workspace_activate (new_workspace);
+	
+	return TRUE;
+}
+
 static void 
 response_cb (GtkWidget *widget,
 	     int        id,
@@ -154,7 +208,7 @@
 {
 	if (id == GTK_RESPONSE_HELP) {
 		GError *error = NULL;
-
+		
 		gnome_help_display_desktop_on_screen (
 			NULL, "workspace-switcher", "workspace-switcher", "workspacelist-prefs",
 			gtk_widget_get_screen (pager->applet),
@@ -428,6 +482,10 @@
 			  "change_orient",
 			  G_CALLBACK (applet_change_orient),
 			  pager);
+	g_signal_connect (G_OBJECT (pager->applet),
+			  "scroll-event",
+			  G_CALLBACK (applet_scroll),
+			  pager);
 	
 	panel_applet_setup_menu_from_file (PANEL_APPLET (pager->applet),
 					   NULL,
