Index: applets/wncklet/window-list.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/wncklet/window-list.c,v
retrieving revision 1.74
diff -u -p -r1.74 window-list.c
--- applets/wncklet/window-list.c	3 Oct 2005 06:49:56 -0000	1.74
+++ applets/wncklet/window-list.c	22 Oct 2005 14:40:17 -0000
@@ -207,6 +207,70 @@ applet_change_background (PanelApplet   
 				   color, pixmap);
 }
 
+static gboolean
+applet_scroll (PanelApplet    *applet,
+               GdkEventScroll *event,
+               TasklistData   *tasklist)
+{
+	WnckScreen *screen;
+	WnckWindow *window;
+	WnckWindow *window_to_activate;
+	WnckWorkspace *workspace;
+	GList *window_list;
+	
+	if (event->type != GDK_SCROLL)
+		return FALSE;
+
+	screen = wncklet_get_screen (GTK_WIDGET (applet));
+	window = wnck_screen_get_active_window (screen);
+	if (window == NULL)
+		return TRUE;
+	workspace = wnck_window_get_workspace (window);
+	window_list = g_list_find (wnck_screen_get_windows (screen), window);
+	if (window_list == NULL)
+		return TRUE;
+
+	/* either step forward or backward through the list, starting from the
+	   currently active window, to find the new window to activate */
+	window_to_activate = NULL;
+	switch (event->direction) {
+	case GDK_SCROLL_DOWN:
+	case GDK_SCROLL_RIGHT:
+		window_list = window_list->next;
+		while (window_list != NULL) {
+			WnckWindow *w = (WnckWindow *) window_list->data;
+			if (workspace == wnck_window_get_workspace (w)) {
+				window_to_activate = w;
+				break;
+			}
+			window_list = window_list->next;
+		}
+		break;
+		
+	case GDK_SCROLL_UP:
+	case GDK_SCROLL_LEFT:
+		window_list = window_list->prev;
+		while (window_list != NULL) {
+			WnckWindow *w = (WnckWindow *) window_list->data;
+			if (workspace == wnck_window_get_workspace (w)) {
+				window_to_activate = w;
+				break;
+			}
+			window_list = window_list->prev;
+		}
+		break;
+
+	default:
+		g_assert_not_reached ();
+		break;
+	}
+
+	if (window_to_activate != NULL)
+		wnck_window_activate (window_to_activate, event->time);
+
+	return TRUE;
+}
+
 static void
 applet_change_pixel_size (PanelApplet  *applet,
 			  gint          size,
@@ -733,6 +797,10 @@ window_list_applet_fill (PanelApplet *ap
 	g_signal_connect (G_OBJECT (tasklist->applet),
 			  "change_background",
 			  G_CALLBACK (applet_change_background),
+			  tasklist);
+	g_signal_connect (G_OBJECT (tasklist->applet),
+			  "scroll-event",
+			  G_CALLBACK (applet_scroll),
 			  tasklist);
 	
 	panel_applet_setup_menu_from_file (PANEL_APPLET (tasklist->applet),
Index: applets/wncklet/window-menu.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/wncklet/window-menu.c,v
retrieving revision 1.38
diff -u -p -r1.38 window-menu.c
--- applets/wncklet/window-menu.c	6 Jun 2005 22:23:19 -0000	1.38
+++ applets/wncklet/window-menu.c	22 Oct 2005 14:40:18 -0000
@@ -35,7 +35,7 @@
 #include <panel-applet.h>
 #include <gdk/gdkkeysyms.h>
 
-#include <libwnck/selector.h>
+#include <libwnck/libwnck.h>
 
 #include "wncklet.h"
 #include "window-menu.h"
@@ -200,6 +200,70 @@ window_menu_size_allocate (PanelApplet	 
 }
 
 static gboolean
+window_menu_scroll_event (PanelApplet    *applet,
+                          GdkEventScroll *event,
+                          WindowMenu     *window_menu)
+{
+	WnckScreen *screen;
+	WnckWindow *window;
+	WnckWindow *window_to_activate;
+	WnckWorkspace *workspace;
+	GList *window_list;
+	
+	if (event->type != GDK_SCROLL)
+		return FALSE;
+
+	screen = wncklet_get_screen (GTK_WIDGET (applet));
+	window = wnck_screen_get_active_window (screen);
+	if (window == NULL)
+		return TRUE;
+	workspace = wnck_window_get_workspace (window);
+	window_list = g_list_find (wnck_screen_get_windows (screen), window);
+	if (window_list == NULL)
+		return TRUE;
+
+	/* either step forward or backward through the list, starting from the
+	   currently active window, to find the new window to activate */
+	window_to_activate = NULL;
+	switch (event->direction) {
+	case GDK_SCROLL_DOWN:
+	case GDK_SCROLL_RIGHT:
+		window_list = window_list->next;
+		while (window_list != NULL) {
+			WnckWindow *w = (WnckWindow *) window_list->data;
+			if (workspace == wnck_window_get_workspace (w)) {
+				window_to_activate = w;
+				break;
+			}
+			window_list = window_list->next;
+		}
+		break;
+		
+	case GDK_SCROLL_UP:
+	case GDK_SCROLL_LEFT:
+		window_list = window_list->prev;
+		while (window_list != NULL) {
+			WnckWindow *w = (WnckWindow *) window_list->data;
+			if (workspace == wnck_window_get_workspace (w)) {
+				window_to_activate = w;
+				break;
+			}
+			window_list = window_list->prev;
+		}
+		break;
+
+	default:
+		g_assert_not_reached ();
+		break;
+	}
+
+	if (window_to_activate != NULL)
+		wnck_window_activate (window_to_activate, event->time);
+
+	return TRUE;
+}
+
+static gboolean
 window_menu_key_press_event (GtkWidget   *widget,
                              GdkEventKey *event,
                              WindowMenu  *window_menu)
@@ -281,6 +345,8 @@ window_menu_applet_fill (PanelApplet *ap
 			  G_CALLBACK (window_menu_key_press_event), window_menu);
 	g_signal_connect (window_menu->applet, "size-allocate",
 			  G_CALLBACK (window_menu_size_allocate), window_menu);
+	g_signal_connect (G_OBJECT (window_menu->applet), "scroll-event",
+			  G_CALLBACK (window_menu_scroll_event), window_menu);
 
 	g_signal_connect_after (G_OBJECT (window_menu->applet), "focus-in-event",
 				G_CALLBACK (gtk_widget_queue_draw), window_menu);
