diff options
author | Kristian Rietveld <kris@gtk.org> | 2005-06-19 19:22:46 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2005-06-19 19:22:46 +0000 |
commit | d7cfee4b1617527207eebd447f0b687e75a2050d (patch) | |
tree | 8b498c06a3657a5a1cef91e8a5ecd43fed25a658 /gtk | |
parent | 1bdf71943fc1ee06df3a5e091987b7fb7b13c08d (diff) | |
download | gdk-pixbuf-d7cfee4b1617527207eebd447f0b687e75a2050d.tar.gz |
added a check which avoids processing updates on bin_window and scrolling
2005-06-19 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_clamp_node_visible): added a
check which avoids processing updates on bin_window and scrolling
if the node is already visible. (#170600, Billy Biggs).
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktreeview.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 28e121891..e3bf7069e 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -4561,7 +4561,7 @@ validate_row (GtkTreeView *tree_view, gboolean retval = FALSE; gboolean is_separator = FALSE; gint focus_pad; - + /* double check the row needs validating */ if (! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_INVALID) && ! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_COLUMN_INVALID)) @@ -7828,13 +7828,22 @@ gtk_tree_view_clamp_node_visible (GtkTreeView *tree_view, GtkRBTree *tree, GtkRBNode *node) { + gint node_dy, height; GtkTreePath *path = NULL; if (!GTK_WIDGET_REALIZED (tree_view)) return; - path = _gtk_tree_view_find_path (tree_view, tree, node); + /* just return if the node is visible, avoiding a costly expose */ + node_dy = _gtk_rbtree_node_find_offset (tree, node); + height = ROW_HEIGHT (tree_view, GTK_RBNODE_GET_HEIGHT (node)); + if (! GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_INVALID) + && node_dy >= tree_view->priv->vadjustment->value + && node_dy + height <= (tree_view->priv->vadjustment->value + + tree_view->priv->vadjustment->page_size)) + return; + path = _gtk_tree_view_find_path (tree_view, tree, node); if (path) { /* We process updates because we want to clear old selected items when we scroll. |