[gtk+/rendering-cleanup-next: 37/203] treeview: Invalidate on expander changes, don't just repaint



commit 91a0492b56fe06a4bb61b85efd2a06d0e7a6acbf
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 6 13:27:50 2010 +0200

    treeview: Invalidate on expander changes, don't just repaint
    
    Repaints are supposed to be initiated by GDK, not by random repaints.

 gtk/gtktreeview.c |   41 ++++++++++++-----------------------------
 1 files changed, 12 insertions(+), 29 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index cfa5dd0..4a195f8 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -324,8 +324,7 @@ static void     gtk_tree_view_queue_draw_path                (GtkTreeView
 							      const GdkRectangle *clip_rect);
 static void     gtk_tree_view_queue_draw_arrow               (GtkTreeView        *tree_view,
 							      GtkRBTree          *tree,
-							      GtkRBNode          *node,
-							      const GdkRectangle *clip_rect);
+							      GtkRBNode          *node);
 static void     gtk_tree_view_draw_arrow                     (GtkTreeView        *tree_view,
 							      GtkRBTree          *tree,
 							      GtkRBNode          *node,
@@ -2610,11 +2609,9 @@ gtk_tree_view_button_press (GtkWidget      *widget,
 	      gtk_grab_add (widget);
 	      tree_view->priv->button_pressed_node = tree_view->priv->prelight_node;
 	      tree_view->priv->button_pressed_tree = tree_view->priv->prelight_tree;
-	      gtk_tree_view_draw_arrow (GTK_TREE_VIEW (widget),
-					tree_view->priv->prelight_tree,
-					tree_view->priv->prelight_node,
-					event->x,
-					event->y);
+	      gtk_tree_view_queue_draw_arrow (GTK_TREE_VIEW (widget),
+                                              tree_view->priv->prelight_tree,
+                                              tree_view->priv->prelight_node);
 	    }
 
 	  grab_focus_and_unset_draw_keyfocus (tree_view);
@@ -3221,7 +3218,7 @@ do_prelight (GtkTreeView *tree_view,
 		GTK_TREE_VIEW_UNSET_FLAG (tree_view,
 					  GTK_TREE_VIEW_ARROW_PRELIT);
 
-	      gtk_tree_view_draw_arrow (tree_view, tree, node, x, y);
+	      gtk_tree_view_queue_draw_arrow (tree_view, tree, node);
 	    }
 	}
 
@@ -3240,11 +3237,9 @@ do_prelight (GtkTreeView *tree_view,
 	{
 	  GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_ARROW_PRELIT);
 	  
-	  gtk_tree_view_draw_arrow (tree_view,
-				    tree_view->priv->prelight_tree,
-				    tree_view->priv->prelight_node,
-				    x,
-				    y);
+	  gtk_tree_view_queue_draw_arrow (tree_view,
+                                          tree_view->priv->prelight_tree,
+                                          tree_view->priv->prelight_node);
 	}
 
       _gtk_tree_view_queue_draw_node (tree_view,
@@ -3271,7 +3266,7 @@ do_prelight (GtkTreeView *tree_view,
     {
       GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_ARROW_PRELIT);
 
-      gtk_tree_view_draw_arrow (tree_view, tree, node, x, y);
+      gtk_tree_view_queue_draw_arrow (tree_view, tree, node);
     }
 
   GTK_RBNODE_SET_FLAG (node, GTK_RBNODE_IS_PRELIT);
@@ -9445,8 +9440,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
 static void
 gtk_tree_view_queue_draw_arrow (GtkTreeView        *tree_view,
 				GtkRBTree          *tree,
-				GtkRBNode          *node,
-				const GdkRectangle *clip_rect)
+				GtkRBNode          *node)
 {
   GtkAllocation allocation;
   GdkRectangle rect;
@@ -9461,18 +9455,7 @@ gtk_tree_view_queue_draw_arrow (GtkTreeView        *tree_view,
   rect.y = BACKGROUND_FIRST_PIXEL (tree_view, tree, node);
   rect.height = ROW_HEIGHT (tree_view, BACKGROUND_HEIGHT (node));
 
-  if (clip_rect)
-    {
-      GdkRectangle new_rect;
-
-      gdk_rectangle_intersect (clip_rect, &rect, &new_rect);
-
-      gdk_window_invalidate_rect (tree_view->priv->bin_window, &new_rect, TRUE);
-    }
-  else
-    {
-      gdk_window_invalidate_rect (tree_view->priv->bin_window, &rect, TRUE);
-    }
+  gdk_window_invalidate_rect (tree_view->priv->bin_window, &rect, TRUE);
 }
 
 void
@@ -12038,7 +12021,7 @@ do_expand_collapse (GtkTreeView *tree_view)
 
   if (redraw)
     {
-      gtk_tree_view_queue_draw_arrow (tree_view, tree, node, NULL);
+      gtk_tree_view_queue_draw_arrow (tree_view, tree, node);
 
       return TRUE;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]