Index: libwnck/tasklist.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/tasklist.c,v
retrieving revision 1.87
diff -r1.87 tasklist.c
129a130,131
>   
>   guint row, col;
1287c1289
<   GList *l;
---
>   GList *l, *l2;
1297a1300
>   GList *windows_sorted = NULL;
1370d1372
< 
1415a1418,1430
>       /* Build sorted windows list */
>       if (g_list_length (task->windows) > 1)
>         windows_sorted = g_list_concat (windows_sorted,
>                                        g_list_copy (task->windows));
>       else
>         windows_sorted = g_list_append (windows_sorted, task);
>       task->row = row;
>       task->col = col;
>       for (l2 = task->windows; l2; l2 = l2->next)
>         {
>           WNCK_TASK (l2->data)->row = row;
>           WNCK_TASK (l2->data)->col = col;
>         }
1423a1439,1440
>   g_list_free (tasklist->priv->windows);
>   tasklist->priv->windows = windows_sorted;
1656a1674,1728
> static gboolean
> wnck_tasklist_scroll_cb (WnckTasklist *tasklist,
>                          GdkEventScroll *event,
>                          gpointer user_data)
> {
>   GList *window;
>   gint row, col;
> 
>   window = g_list_find (tasklist->priv->windows,
>                         tasklist->priv->active_task);
>   row = WNCK_TASK (window->data)->row;
>   col = WNCK_TASK (window->data)->col;
> 
>   switch (event->direction)
>     {
>       case GDK_SCROLL_UP:
>         if (!window)
>           window = g_list_last (tasklist->priv->windows);
>         else
>           window = window->prev;
>       break;
> 
>       case GDK_SCROLL_DOWN:
>         if (!window)
>           window = tasklist->priv->windows;
>         else
>           window = window->next;
>       break;
> 
>       case GDK_SCROLL_LEFT:
>         while (window && (WNCK_TASK(window->data)->row != row ||
>                           WNCK_TASK(window->data)->col != col-1))
>           window = window->prev;
>         if (!window)
>           window = tasklist->priv->windows;
>       break;
> 
>       case GDK_SCROLL_RIGHT:
>         while (window && (WNCK_TASK(window->data)->row != row ||
>                           WNCK_TASK(window->data)->col != col+1))
>           window = window->next;
>         if (!window)
>           window = g_list_last (tasklist->priv->windows);
>       break;
> 
>       default:
>         g_assert_not_reached ();
>     }
> 
>   if (window)
>     wnck_tasklist_activate_task_window (window->data, event->time);
> 
>   return TRUE;
> }
> 
1669a1742,1748
>   /* callback when there is a scroll-event for switching to the next window  */
>   g_signal_connect_object (G_OBJECT (tasklist),
>                            "scroll-event",
>                            G_CALLBACK (wnck_tasklist_scroll_cb),
>                            G_OBJECT (tasklist),
>                            0);
>   
