[gtk+/rendering-cleanup] Create cairo context after running validate_visible_area()



commit 7cb0851141badb54d6adda5b82ff805717e35648
Author: Kristian Rietveld <kris gtk org>
Date:   Wed Sep 15 14:20:31 2010 +0200

    Create cairo context after running validate_visible_area()
    
    validate_visible_area() can change the vertical adjustment and thus
    trigger window moves/scrolls.  This seems to change the surface for
    which gtk_tree_view_bin_expose() just created a cairo context.  Creating
    the cairo context after the call to validate_visible_area() fixes
    such crashes.

 gtk/gtktreeview.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a712c54..e15f155 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -4405,12 +4405,12 @@ gtk_tree_view_bin_expose (GtkWidget      *widget,
   if (event->area.height < 0)
     return TRUE;
 
+  validate_visible_area (tree_view);
+
   cr = gdk_cairo_create (event->window);
   gdk_cairo_region (cr, event->region);
   cairo_clip (cr);
 
-  validate_visible_area (tree_view);
-
   style = gtk_widget_get_style (widget);
 
   new_y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, event->area.y);



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