diff -Nurp gtk+-pre/gtk/gtkrbtree.c gtk+-post/gtk/gtkrbtree.c
--- gtk+-pre/gtk/gtkrbtree.c	2006-01-17 23:23:24.000000000 -0600
+++ gtk+-post/gtk/gtkrbtree.c	2006-04-29 19:20:26.000000000 -0500
@@ -993,8 +993,8 @@ _gtk_rbtree_node_find_offset (GtkRBTree 
 }
 
 gint
-_gtk_rbtree_node_find_parity (GtkRBTree *tree,
-                              GtkRBNode *node)
+_gtk_rbtree_node_find_n_parity (GtkRBTree *tree,
+                                GtkRBNode *node)
 {
   GtkRBNode *last;
   gint retval;  
@@ -1024,7 +1024,14 @@ _gtk_rbtree_node_find_parity (GtkRBTree 
 	}
     }
   
-  return retval % 2;
+  return retval;
+}
+
+gint
+_gtk_rbtree_node_find_parity (GtkRBTree *tree,
+                              GtkRBNode *node)
+{
+  return _gtk_rbtree_node_find_n_parity (tree, node) % 2;
 }
 
 gint
diff -Nurp gtk+-pre/gtk/gtkrbtree.h gtk+-post/gtk/gtkrbtree.h
--- gtk+-pre/gtk/gtkrbtree.h	2005-11-01 12:10:51.000000000 -0600
+++ gtk+-post/gtk/gtkrbtree.h	2006-04-29 19:20:26.000000000 -0500
@@ -27,6 +27,7 @@
 
 G_BEGIN_DECLS
 
+#define GTK_RBTREE_PARITY_BITS 18
 
 typedef enum
 {
@@ -80,7 +81,7 @@ struct _GtkRBNode
    * but that would use extra memory.
    */
 
-  guint parity : 1;
+  guint parity : GTK_RBTREE_PARITY_BITS;
   
   GtkRBNode *left;
   GtkRBNode *right;
@@ -146,6 +147,8 @@ gint       _gtk_rbtree_node_find_offset 
 					 GtkRBNode              *node);
 gint       _gtk_rbtree_node_find_parity (GtkRBTree              *tree,
 					 GtkRBNode              *node);
+gint       _gtk_rbtree_node_find_n_parity (GtkRBTree            *tree,
+                                           GtkRBNode            *node);
 gint       _gtk_rbtree_find_offset      (GtkRBTree              *tree,
 					 gint                    offset,
 					 GtkRBTree             **new_tree,
diff -Nurp gtk+-pre/gtk/gtktreeprivate.h gtk+-post/gtk/gtktreeprivate.h
--- gtk+-pre/gtk/gtktreeprivate.h	2006-04-26 07:39:25.000000000 -0500
+++ gtk+-post/gtk/gtktreeprivate.h	2006-04-29 19:20:26.000000000 -0500
@@ -214,6 +214,13 @@ struct _GtkTreeViewPrivate
   /* Auto expand/collapse timeout in hover mode */
   guint auto_expand_timeout;
 
+  /* When showing rules, the number of consecutive rows to show in the same
+   * rule color */
+  guint rules_interval;
+
+  /* The rule state of the first row in the tree */
+  guint rules_offset;
+
   gint selected_iter;
   gint search_column;
   GtkTreeViewSearchPositionFunc search_position_func;
diff -Nurp gtk+-pre/gtk/gtktreeview.c gtk+-post/gtk/gtktreeview.c
--- gtk+-pre/gtk/gtktreeview.c	2006-04-28 09:32:09.000000000 -0500
+++ gtk+-post/gtk/gtktreeview.c	2006-04-29 19:20:26.000000000 -0500
@@ -20,6 +20,7 @@
 
 #include <config.h>
 #include <string.h>
+#include <stdlib.h>  /* abs */
 #include <gdk/gdkkeysyms.h>
 
 #include "gtktreeview.h"
@@ -732,6 +733,7 @@ gtk_tree_view_class_init (GtkTreeViewCla
 #define _TREE_VIEW_EXPANDER_SIZE 12
 #define _TREE_VIEW_VERTICAL_SEPARATOR 2
 #define _TREE_VIEW_HORIZONTAL_SEPARATOR 2
+#define _TREE_VIEW_RULES_INTERVAL 1
     
   gtk_widget_class_install_style_property (widget_class,
 					   g_param_spec_int ("expander-size",
@@ -768,6 +770,15 @@ gtk_tree_view_class_init (GtkTreeViewCla
 								 GTK_PARAM_READABLE));
 
   gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_int ("rules-interval",
+							     P_("Rules Interval"),
+							     P_("The number of consecutive rows to show in the same color when alternating"),
+							     1,
+							     (1 << (GTK_RBTREE_PARITY_BITS - 1)) - 1,
+							     _TREE_VIEW_RULES_INTERVAL,
+							     GTK_PARAM_READWRITE));
+
+  gtk_widget_class_install_style_property (widget_class,
 					   g_param_spec_boolean ("indent-expanders",
 								 P_("Indent Expanders"),
 								 P_("Make the expanders indented"),
@@ -3566,6 +3577,7 @@ gtk_tree_view_bin_expose (GtkWidget     
   gint pointer_x, pointer_y;
   gboolean got_pointer = FALSE;
   gboolean row_ending_details;
+  guint rules_interval;
 
   g_return_val_if_fail (GTK_IS_TREE_VIEW (widget), FALSE);
 
@@ -3579,6 +3591,7 @@ gtk_tree_view_bin_expose (GtkWidget     
 			"allow-rules", &allow_rules,
 			"focus-line-width", &focus_line_width,
 			"row-ending-details", &row_ending_details,
+			"rules-interval", &rules_interval,
 			NULL);
 
   if (tree_view->priv->tree == NULL)
@@ -3668,7 +3681,7 @@ gtk_tree_view_bin_expose (GtkWidget     
 
   do
     {
-      gboolean parity;
+      guint parity;
       gboolean is_separator = FALSE;
       gboolean is_first = FALSE;
       gboolean is_last = FALSE;
@@ -3697,7 +3710,8 @@ gtk_tree_view_bin_expose (GtkWidget     
       if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
         flags |= GTK_CELL_RENDERER_SELECTED;
 
-      parity = _gtk_rbtree_node_find_parity (tree, node);
+      parity = _gtk_rbtree_node_find_n_parity (tree, node);
+      parity = ((abs (parity) - tree_view->priv->rules_offset) / rules_interval) % 2;
 
       /* we *need* to set cell data on all cells before the call
        * to _has_special_cell, else _has_special_cell() does not
@@ -7432,6 +7446,33 @@ gtk_tree_view_row_changed (GtkTreeModel 
 }
 
 static void
+adjust_rules_offset_for_path (GtkTreeView *tree_view, GtkTreePath *path)
+{
+  GtkTreePath *top_path;
+
+  if (!tree_view->priv->top_row)
+    return;
+
+  top_path = gtk_tree_row_reference_get_path (tree_view->priv->top_row);
+  if (!top_path)
+    return;
+
+  if (gtk_tree_path_compare (path, top_path) < 0)
+    {
+      guint rules_interval;
+
+      gtk_widget_style_get (GTK_WIDGET (tree_view),
+                            "rules-interval", &rules_interval,
+                            NULL);
+
+      tree_view->priv->rules_offset++;
+      tree_view->priv->rules_offset %= rules_interval * 2;
+    }
+
+  gtk_tree_path_free (top_path);
+}
+
+static void
 gtk_tree_view_row_inserted (GtkTreeModel *model,
 			    GtkTreePath  *path,
 			    GtkTreeIter  *iter,
@@ -7463,6 +7504,8 @@ gtk_tree_view_row_inserted (GtkTreeModel
   else if (iter == NULL)
     gtk_tree_model_get_iter (model, iter, path);
 
+  adjust_rules_offset_for_path (tree_view, path);
+
   if (tree_view->priv->tree == NULL)
     tree_view->priv->tree = _gtk_rbtree_new ();
 
@@ -7664,6 +7707,8 @@ gtk_tree_view_row_deleted (GtkTreeModel 
   if (tree == NULL)
     return;
 
+  adjust_rules_offset_for_path (tree_view, path);
+
   /* check if the selection has been changed */
   _gtk_rbtree_traverse (tree, node, G_POST_ORDER,
                         check_selection_helper, &selection_changed);
diff -Nurp gtk+-pre/tests/Makefile.am gtk+-post/tests/Makefile.am
--- gtk+-pre/tests/Makefile.am	2006-04-26 07:39:25.000000000 -0500
+++ gtk+-post/tests/Makefile.am	2006-04-29 19:20:26.000000000 -0500
@@ -68,6 +68,7 @@ noinst_PROGRAMS =			\
 	testtreeview			\
 	testtreefocus			\
 	testtreeflow			\
+	testtreecolors			\
 	testtreecolumns			\
 	testtreesort			\
 	treestoretest			\
@@ -121,6 +122,7 @@ testtreemodel_DEPENDENCIES = $(DEPS)
 testtreeview_DEPENDENCIES = $(DEPS)
 testtreefocus_DEPENDENCIES = $(DEPS)
 testtreeflow_DEPENDENCIES = $(DEPS)
+testtreecolors_DEPENDENCIES = $(DEPS)
 testtreecolumns_DEPENDENCIES = $(DEPS)
 testtreesort_DEPENDENCIES = $(DEPS)
 treestoretest_DEPENDENCIES = $(TEST_DEPS)
@@ -170,6 +172,7 @@ testtreemodel_LDADD = $(LDADDS)
 testtreeview_LDADD = $(LDADDS)
 testtreefocus_LDADD = $(LDADDS)
 testtreeflow_LDADD = $(LDADDS)
+testtreecolors_LDADD = $(LDADDS)
 testtreecolumns_LDADD = $(LDADDS)
 testtreesort_LDADD = $(LDADDS)
 testtext_LDADD = $(LDADDS)
diff -Nurp gtk+-pre/tests/testtreecolors.c gtk+-post/tests/testtreecolors.c
--- gtk+-pre/tests/testtreecolors.c	1969-12-31 18:00:00.000000000 -0600
+++ gtk+-post/tests/testtreecolors.c	2006-04-29 19:20:45.000000000 -0500
@@ -0,0 +1,147 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+
+/* testtreecolors.c
+ * Copyright (C) 2006 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#define N_COLUMNS 3
+#define ADD_ROWS_TIMEOUT_MS 250
+
+#include <config.h>
+#include <string.h>
+#include <gtk/gtk.h>
+
+static gboolean
+add_rows (GtkTreeModel *model)
+{
+  static gint  n = 0;
+  GtkTreeIter  iter;
+  gchar       *prepend_string;
+  gchar       *append_string;
+
+  prepend_string = g_strdup_printf ("Prependage #%d", n);
+  append_string = g_strdup_printf ("Appendage #%d", n);
+  n++;
+
+#if 0
+  gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, 0,
+                                     0, prepend_string,
+                                     1, prepend_string,
+                                     2, prepend_string,
+                                     -1);
+                                     
+
+  gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, G_MAXINT,
+                                     0, append_string,
+                                     1, append_string,
+                                     2, append_string,
+                                     -1);
+#endif
+
+  gtk_list_store_prepend (GTK_LIST_STORE (model), &iter);
+  gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+                      0, prepend_string,
+                      1, prepend_string,
+                      2, prepend_string,
+                      -1);
+
+  gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+  gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+                      0, append_string,
+                      1, append_string,
+                      2, append_string,
+                      -1);
+
+  return TRUE;
+}
+
+static const gchar style [] =
+"style \"test\" = \"theme-default\"\n"
+"{\n"
+"  GtkTreeView::rules-interval = 4\n"
+"}\n"
+"class \"GtkTreeView\" style \"test\"\n";
+
+static GtkWidget *
+construct_tree_view (void)
+{
+  GtkTreeModel      *model;
+  GtkTreeModel      *model_sort;
+  GtkTreeView       *view;
+  GtkScrolledWindow *scrolled_window;
+  gint               i;
+
+  gtk_rc_parse_string (style);
+
+  model = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING));
+  model_sort = gtk_tree_model_sort_new_with_model (model);
+  view = GTK_TREE_VIEW (gtk_tree_view_new_with_model (model_sort));
+  scrolled_window = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new (NULL, NULL));
+  gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (view));
+
+  for (i = 0; i < N_COLUMNS; i++)
+    {
+      GtkCellRenderer   *renderer;
+      GtkTreeViewColumn *column;
+      gchar             *name;
+
+      name = g_strdup_printf ("%d", i);
+
+      renderer = gtk_cell_renderer_text_new ();
+      column = gtk_tree_view_column_new_with_attributes (name,
+                                                         renderer,
+                                                         "text", i,
+                                                         NULL);
+
+      g_object_set (column,
+                    "expand", TRUE,
+                    NULL);
+
+      gtk_tree_view_column_set_sort_column_id (column, i);
+      gtk_tree_view_append_column (view, column);
+
+      g_free (name);
+    }
+
+  gtk_tree_view_set_rules_hint (view, TRUE);
+
+  g_timeout_add (ADD_ROWS_TIMEOUT_MS, (GSourceFunc) add_rows, model);
+
+  return GTK_WIDGET (scrolled_window);
+}
+
+gint
+main (gint argc, gchar *argv [])
+{
+  GtkWidget *tree_view_box;
+  GtkWindow *window;
+
+  gtk_init (&argc, &argv);
+
+  window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
+  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+  gtk_window_set_default_size (window, 400, 400);
+
+  tree_view_box = construct_tree_view ();
+  gtk_container_add (GTK_CONTAINER (window), tree_view_box);
+
+  gtk_widget_show_all (GTK_WIDGET (window));
+
+  gtk_main ();
+  return 0;
+}
