summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2005-06-19 19:22:46 +0000
committerKristian Rietveld <kristian@src.gnome.org>2005-06-19 19:22:46 +0000
commitd7cfee4b1617527207eebd447f0b687e75a2050d (patch)
tree8b498c06a3657a5a1cef91e8a5ecd43fed25a658
parent1bdf71943fc1ee06df3a5e091987b7fb7b13c08d (diff)
downloadgdk-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).
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-2-106
-rw-r--r--ChangeLog.pre-2-86
-rw-r--r--gtk/gtktreeview.c13
4 files changed, 29 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7da0dce54..4a7ef3697 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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).
+
+2005-06-19 Kristian Rietveld <kris@gtk.org>
+
* gtk/gtktreeview.c (validate_visible_area): only keep the
row at the same position if the full row is visible. (#304623,
Jorn Baayen).
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 7da0dce54..4a7ef3697 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,11 @@
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).
+
+2005-06-19 Kristian Rietveld <kris@gtk.org>
+
* gtk/gtktreeview.c (validate_visible_area): only keep the
row at the same position if the full row is visible. (#304623,
Jorn Baayen).
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 7da0dce54..4a7ef3697 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,5 +1,11 @@
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).
+
+2005-06-19 Kristian Rietveld <kris@gtk.org>
+
* gtk/gtktreeview.c (validate_visible_area): only keep the
row at the same position if the full row is visible. (#304623,
Jorn Baayen).
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.